licailing 4 سال پیش
والد
کامیت
2aeda8e98e

+ 1 - 0
src/main/java/com/izouma/wenlvju/domain/Record.java

@@ -72,6 +72,7 @@ public class Record extends BaseEntity {
     @ApiModelProperty(value = "备案时间")
     private LocalDate recordTime;
 
+    @SearchableOne
     private String district;
 
     @ApiModelProperty(value = "考试简章")

+ 33 - 26
src/main/java/com/izouma/wenlvju/dto/RecordDTO.java

@@ -3,8 +3,10 @@ package com.izouma.wenlvju.dto;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.metadata.BaseRowModel;
 import com.izouma.wenlvju.domain.Record;
 import com.izouma.wenlvju.domain.RecordSpecialty;
+import com.izouma.wenlvju.utils.excel.LocalDateConverter;
 import io.swagger.annotations.ApiModel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
@@ -18,83 +20,88 @@ import java.time.LocalDate;
 @AllArgsConstructor
 @NoArgsConstructor
 @ApiModel(value = "备案管理")
-public class RecordDTO {
-    @ExcelProperty(value = "考级活动名称")
+public class RecordDTO extends BaseRowModel {
+    @ExcelProperty(value = "备案序号", index = 0)
+    private long no;
+
+    @ExcelProperty(value = "考级活动名称", index = 1)
     private String examinationName;
 
-    @ExcelProperty(value = "考级活动时间")
+    @ExcelProperty(value = "考级活动时间", index = 2, converter = LocalDateConverter.class)
     private LocalDate examinationStartTime;
 
-    @ExcelProperty(value = "考级活动时间")
+    @ExcelProperty(value = "考级活动时间", index = 3, converter = LocalDateConverter.class)
     private LocalDate examinationEndTime;
 
-    @ExcelProperty(value = "考级机构名称")
+    @ExcelProperty(value = "考级机构名称", index = 4)
     private String examinationAgency;
 
-    @ExcelProperty(value = "单位类别")
+    @ExcelProperty(value = "单位类别", index = 5)
     private String category;
 
-    @ExcelProperty(value = "承办单位名称")
+    @ExcelProperty(value = "承办单位名称", index = 6)
     private String organizer;
 
-    @ExcelProperty(value = "统一社会信用代码")
+    @ExcelProperty(value = "统一社会信用代码", index = 7)
     private String uscc;
 
-    @ExcelProperty(value = "考级地址")
+    @ExcelProperty(value = "考级地址", index = 8)
     private String district;
 
-    @ExcelProperty(value = "考级详细地址")
+    @ExcelProperty(value = "考级详细地址", index = 9)
     private String examinationAddress;
 
-    @ExcelProperty(value = "考场数量")
+    @ExcelProperty(value = "考场数量", index = 10)
     private int examCenterQuantity;
 
-    @ExcelProperty(value = "报考人数")
+    @ExcelProperty(value = "报考人数", index = 11)
     private int examQuantity;
 
-    @ExcelProperty(value = "考官人数")
+    @ExcelProperty(value = "考官人数", index = 12)
     private int examinerQuantity;
 
-    @ExcelProperty(value = "考点负责人名称")
+    @ExcelProperty(value = "考点负责人名称", index = 13)
     private String examOwner;
 
-    @ExcelProperty(value = "考点负责人手机号")
+    @ExcelProperty(value = "考点负责人手机号", index = 14)
     private String examOwnerPhone;
 
-    @ExcelProperty(value = "安全负责人名称")
+    @ExcelProperty(value = "安全负责人名称", index = 15)
     private String securityOwner;
 
-    @ExcelProperty(value = "安全负责人手机号")
+    @ExcelProperty(value = "安全负责人手机号", index = 16)
     private String securityOwnerPhone;
 
-    @ExcelProperty(value = "备案时间")
+    @ExcelProperty(value = "备案时间", index = 17, converter = LocalDateConverter.class)
     private LocalDate recordTime;
 
-    @ExcelProperty(value = "考试简章")
+    @ExcelProperty(value = "考试简章", index = 18)
     private String examinationGuide;
 
-    @ExcelProperty(value = "考级专业名称")
+    @ExcelProperty(value = "考级专业名称", index = 19)
     private String name;
 
-    @ExcelProperty(value = "考级专业代码")
+    @ExcelProperty(value = "考级专业代码", index = 20)
     private String code;
 
-    @ExcelProperty(value = "考级专业总级数")
+    @ExcelProperty(value = "考级专业总级数", index = 21)
     private String level;
 
-    @ExcelProperty(value = "考级专业考场数量")
+    @ExcelProperty(value = "考级专业考场数量", index = 22)
     private int numOfExam;
 
-    @ExcelProperty(value = "考级专业考官人数")
+    @ExcelProperty(value = "考级专业考官人数", index = 23)
     private int speExaQuantity;
 
-    public RecordDTO(Record record, RecordSpecialty specialty) {
+    public RecordDTO(Record record, RecordSpecialty specialty, long no) {
         BeanUtil.copyProperties(record, this);
         this.examinerQuantity = record.getExaminerQuantity();
 
-        if (ObjectUtil.isNotEmpty(specialty)){
+        if (ObjectUtil.isNotEmpty(specialty)) {
             BeanUtil.copyProperties(specialty, this);
             this.speExaQuantity = specialty.getExaminerQuantity();
         }
+
+        this.no = no;
     }
 }

+ 54 - 4
src/main/java/com/izouma/wenlvju/service/RecordService.java

@@ -1,5 +1,6 @@
 package com.izouma.wenlvju.service;
 
+import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.util.ObjectUtil;
@@ -10,13 +11,19 @@ import com.izouma.wenlvju.dto.RecordDTO;
 import com.izouma.wenlvju.repo.RecordRepo;
 import com.izouma.wenlvju.repo.RecordSpecialtyRepo;
 import com.izouma.wenlvju.utils.JpaUtils;
+import com.izouma.wenlvju.utils.excel.ExcelUtils;
 import jodd.util.StringUtil;
 import lombok.AllArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.data.domain.Page;
 import org.springframework.stereotype.Service;
 
 import javax.persistence.criteria.Predicate;
+import javax.transaction.Transactional;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.time.LocalDate;
 import java.util.ArrayList;
 import java.util.List;
@@ -85,17 +92,60 @@ public class RecordService {
                 .collect(Collectors.groupingBy(RecordSpecialty::getRecordId));
 
         List<RecordDTO> dtos = new ArrayList<>();
-        data.forEach(record -> {
+        long no = 1;
+        for (Record record : data) {
             List<RecordSpecialty> specialtyList = listMap.get(record.getId());
             if (CollUtil.isEmpty(specialtyList)) {
-                dtos.add(new RecordDTO(record, null));
+                dtos.add(new RecordDTO(record, null, no));
             } else {
-                specialtyList.forEach(specialty -> dtos.add(new RecordDTO(record,specialty)));
+                long finalNo = no;
+                specialtyList.forEach(specialty -> dtos.add(new RecordDTO(record, specialty, finalNo)));
             }
-        });
+            no = no + 1;
+        }
 
         return dtos;
     }
 
+    /*
+    导入
+     */
+    @Transactional(rollbackOn = Exception.class)
+    public void upload(InputStream is) throws IOException {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+        byte[] buffer = new byte[1024];
+        int len;
+        while ((len = is.read(buffer)) > -1) {
+            baos.write(buffer, 0, len);
+        }
+        baos.flush();
+
+        InputStream indicatorStream = new ByteArrayInputStream(baos.toByteArray());
+        List<RecordDTO> dtos =
+                ExcelUtils.readExcel(indicatorStream, RecordDTO.class, 1, 1);
+
+        List<RecordSpecialty> specialties = new ArrayList<>();
+        long no = 0;
+        Long recordId = null;
+        for (RecordDTO dto : dtos) {
+            if (no != dto.getNo()) {
+                Record record = new Record();
+                BeanUtil.copyProperties(dto, record);
+                record = recordRepo.save(record);
+                recordId = record.getId();
+                no = dto.getNo();
+            }
+
+
+            RecordSpecialty specialty = new RecordSpecialty();
+            BeanUtil.copyProperties(dto, specialty);
+            specialty.setRecordId(recordId);
+            specialty.setExaminerQuantity(dto.getSpeExaQuantity());
+            specialties.add(specialty);
+        }
+        recordSpecialtyRepo.saveAll(specialties);
+
+    }
 
 }

+ 28 - 0
src/main/java/com/izouma/wenlvju/utils/excel/ExcelListener.java

@@ -0,0 +1,28 @@
+package com.izouma.wenlvju.utils.excel;
+
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.event.AnalysisEventListener;
+import com.alibaba.excel.metadata.BaseRowModel;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Slf4j
+public class ExcelListener<T extends BaseRowModel> extends AnalysisEventListener<T> {
+    private final List<T> rows = new ArrayList<>();
+
+    @Override
+    public void invoke(T object, AnalysisContext context) {
+        rows.add(object);
+    }
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext context) {
+        log.info("read {} rows %n", rows.size());
+    }
+
+    public List<T> getRows() {
+        return rows;
+    }
+}

+ 65 - 4
src/main/java/com/izouma/wenlvju/utils/excel/ExcelUtils.java

@@ -1,13 +1,21 @@
 package com.izouma.wenlvju.utils.excel;
 
 import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.ExcelReader;
+import com.alibaba.excel.ExcelWriter;
+import com.alibaba.excel.metadata.BaseRowModel;
+import com.alibaba.excel.metadata.Sheet;
+import com.alibaba.excel.support.ExcelTypeEnum;
 import io.swagger.annotations.ApiModel;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.poifs.filesystem.FileMagic;
 
 import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
+import java.io.*;
 import java.util.List;
 
+@Slf4j
 public class ExcelUtils<T> {
     public static <T> void export(HttpServletResponse response, List<T> data) throws IOException {
         String fileName = "data.xlsx";
@@ -24,8 +32,61 @@ public class ExcelUtils<T> {
         response.setCharacterEncoding("utf-8");
         response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
         EasyExcel.write(response.getOutputStream(), data.get(0).getClass()).sheet("sheet")
-                 .registerConverter(new LocalDateConverter())
-                 .registerConverter(new LocalDateTimeConverter())
-                 .doWrite(data);
+                .registerConverter(new LocalDateConverter())
+                .registerConverter(new LocalDateTimeConverter())
+                .doWrite(data);
+    }
+
+    /**
+     * 从Excel中读取文件,读取的文件是一个DTO类,该类必须继承BaseRowModel
+     * 具体实例参考 : MemberMarketDto.java
+     * 参考:https://github.com/alibaba/easyexcel
+     * 字符流必须支持标记,FileInputStream 不支持标记,可以使用BufferedInputStream 代替
+     * BufferedInputStream bis = new BufferedInputStream(new FileInputStream(...));
+     */
+    public static <T extends BaseRowModel> List<T> readExcel(final InputStream inputStream, final Class<? extends BaseRowModel> clazz, int sheetNo, int headLineMun) {
+        if (null == inputStream) {
+            throw new NullPointerException("the inputStream is null!");
+        }
+        ExcelListener<T> listener = new ExcelListener<>();
+        // 这里因为EasyExcel-1.1.1版本的bug,所以需要选用下面这个标记已经过期的版本
+        ExcelReader reader = new ExcelReader(inputStream, valueOf(inputStream), null, listener);
+        reader.read(new com.alibaba.excel.metadata.Sheet(sheetNo, headLineMun, clazz));
+
+        return listener.getRows();
+    }
+
+
+    public static void writeExcel(final File file, List<? extends BaseRowModel> list) {
+        try (OutputStream out = new FileOutputStream(file)) {
+            ExcelWriter writer = new ExcelWriter(out, ExcelTypeEnum.XLSX);
+            //写第一个sheet,  有模型映射关系
+            Class<? extends BaseRowModel> t = list.get(0).getClass();
+            Sheet sheet = new Sheet(1, 0, t);
+            writer.write(list, sheet);
+            writer.finish();
+        } catch (IOException e) {
+            log.warn("fail to write to excel file: file[{}]", file.getName(), e);
+        }
+    }
+
+
+    /**
+     * 根据输入流,判断为xls还是xlsx,该方法原本存在于easyexcel 1.1.0 的ExcelTypeEnum中。
+     */
+    public static ExcelTypeEnum valueOf(InputStream inputStream) {
+        try {
+            FileMagic fileMagic = FileMagic.valueOf(inputStream);
+            if (FileMagic.OLE2.equals(fileMagic)) {
+                return ExcelTypeEnum.XLS;
+            }
+            if (FileMagic.OOXML.equals(fileMagic)) {
+                return ExcelTypeEnum.XLSX;
+            }
+            throw new IllegalArgumentException("excelTypeEnum can not null");
+
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
     }
 }

+ 1 - 0
src/main/java/com/izouma/wenlvju/web/ArtTypeController.java

@@ -9,6 +9,7 @@ import com.izouma.wenlvju.utils.ObjUtils;
 import com.izouma.wenlvju.utils.excel.ExcelUtils;
 import lombok.AllArgsConstructor;
 import org.springframework.data.domain.Page;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;

+ 19 - 3
src/main/java/com/izouma/wenlvju/web/RecordController.java

@@ -5,7 +5,6 @@ import com.izouma.wenlvju.domain.Record;
 import com.izouma.wenlvju.domain.User;
 import com.izouma.wenlvju.dto.PageQuery;
 import com.izouma.wenlvju.dto.RecordDTO;
-import com.izouma.wenlvju.dto.RecordExcelDTO;
 import com.izouma.wenlvju.enums.AuthorityName;
 import com.izouma.wenlvju.exception.BusinessException;
 import com.izouma.wenlvju.repo.RecordRepo;
@@ -16,16 +15,20 @@ import com.izouma.wenlvju.utils.ObjUtils;
 import com.izouma.wenlvju.utils.excel.ExcelUtils;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.data.domain.Page;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.io.InputStream;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 
+@Slf4j
 @RestController
 @RequestMapping("/record")
 @AllArgsConstructor
@@ -63,14 +66,15 @@ public class RecordController extends BaseController {
         return recordRepo.findById(id).orElseThrow(new BusinessException("无记录"));
     }
 
+    @PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/del/{id}")
     public void del(@PathVariable Long id) {
         recordRepo.softDelete(id);
     }
 
-    @GetMapping("/excel")
+    @PostMapping("/excel")
     @ResponseBody
-    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+    public void excel(HttpServletResponse response, @RequestBody PageQuery pageQuery) throws IOException {
         List<Record> data = all(pageQuery).getContent();
         List<RecordDTO> collect = recordService.excel(data);
         if (CollUtil.isEmpty(collect)){
@@ -109,5 +113,17 @@ public class RecordController extends BaseController {
     public List<Record> byToday( String district) {
         return recordService.byToday( district);
     }
+
+    @PostMapping("/upload")
+    public void uploadFile(@RequestParam("file") MultipartFile file) {
+        InputStream is;
+        try {
+            is = file.getInputStream();
+            recordService.upload(is);
+        } catch (IOException e) {
+            log.error("上传失败", e);
+            throw new BusinessException("上传失败", e.getMessage());
+        }
+    }
 }
 

+ 0 - 1
src/main/vue/src/views/record/RecordEdit.vue

@@ -144,7 +144,6 @@
                 <el-table-column prop="level" label="总级数"> </el-table-column>
                 <el-table-column prop="numOfExam" label="考场数量"> </el-table-column>
                 <el-table-column prop="examinerQuantity" label="考官人数"> </el-table-column>
-                <el-table-column prop="numOfCandidates" label="考试人数"> </el-table-column>
             </el-table>
             <el-form-item>
                 <div style="margin-top: 10px">

+ 34 - 20
src/main/vue/src/views/record/RecordList.vue

@@ -1,15 +1,15 @@
 <template>
     <div class="list-view">
         <div class="filters-container">
-            <span class="span-width">
+            <el-col :span="7">
                 <span class="span-size">考级活动名称</span>
                 <el-input placeholder="输入考级活动名称" v-model="search" clearable class="filter-item"></el-input>
-            </span>
-            <span class="span-width">
+            </el-col>
+            <el-col :span="7">
                 <span class="span-size">考级机构名称</span>
                 <el-input placeholder="输入考级机构名称" v-model="agency" clearable class="filter-item"></el-input>
-            </span>
-            <span class="span-width">
+            </el-col>
+            <el-col :span="7">
                 <label class="span-size">考级地点</label>
                 <el-select class="filter-item" v-model="districtId" clearable placeholder="请选择区县">
                     <el-option
@@ -19,13 +19,13 @@
                         :label="item.name"
                     ></el-option>
                 </el-select>
-            </span>
-            <span class="span-width">
+            </el-col>
+            <el-col :span="7">
                 <span class="span-size">承办单位名称</span>
                 <el-input placeholder="输入承办单位名称" v-model="organizer" clearable class="filter-item"></el-input>
-            </span>
+            </el-col>
 
-            <span class="span-width2">
+            <el-col :span="14">
                 <label class="span-size">考级活动时间</label>
                 <el-date-picker
                     v-model="dateRange"
@@ -37,11 +37,11 @@
                     class="filter-item"
                 >
                 </el-date-picker>
-            </span>
+            </el-col>
         </div>
         <div style="padding-left: 20px">
             <el-button @click="getData" type="primary" icon="el-icon-search" class="filter-item">查询 </el-button>
-            <el-button @click="addRow" type="primary" icon="el-icon-plus" class="filter-item">上传 </el-button>
+            <el-button @click="addRow" type="primary" icon="el-icon-plus" class="filter-item">批量上传 </el-button>
             <!-- <el-button @click="update" type="primary" icon="el-icon-refresh" class="filter-item"
                     >一键获取
                 </el-button> -->
@@ -212,7 +212,7 @@ export default {
         },
         editRow(row) {
             this.$router.push({
-                path: '/recordInfo',
+                path: '/recordEdit',
                 query: {
                     rid: row.id
                 }
@@ -220,15 +220,29 @@ export default {
         },
         download() {
             this.downloading = true;
+            let data = { sort: 'recordTime,desc', size: 1000, query: { del: false } };
+            if (this.search) {
+                data.search = this.search;
+            }
+            if (this.districtId) {
+                data.query.district = this.districtId;
+            }
+            if (this.recordDateRange && this.recordDateRange.length > 0) {
+                data.query.recordTime = this.recordDateRange[0] + ',' + this.recordDateRange[1];
+            }
+            if (this.dateRange && this.dateRange.length > 0) {
+                data.query.examinationStartTime = this.dateRange[0] + ',' + this.dateRange[1];
+                data.query.examinationEndTime = this.dateRange[0] + ',' + this.dateRange[1];
+            }
+            if (this.agency) {
+                data.query.examinationAgency = this.agency;
+            }
+            if (this.organizer) {
+                data.query.organizer = this.organizer;
+            }
             this.$axios
-                .get('/record/excel', {
-                    responseType: 'blob',
-                    params: {
-                        size: 10000,
-                        query: {
-                            del: false
-                        }
-                    }
+                .post('/record/excel', data, {
+                    responseType: 'blob'
                 })
                 .then(res => {
                     console.log(res);

+ 1 - 1
src/main/vue/src/views/record/RecordSpecialtyList.vue

@@ -29,7 +29,7 @@
             <el-table-column prop="level" label="总级数"> </el-table-column>
             <el-table-column prop="numOfExam" label="考场数量"> </el-table-column>
             <el-table-column prop="examinerQuantity" label="考官人数"> </el-table-column>
-            <el-table-column prop="numOfCandidates" label="考试人数"> </el-table-column>
+            <!-- <el-table-column prop="numOfCandidates" label="考试人数"> </el-table-column> -->
             <!-- <el-table-column prop="numOfQualified" label="合格人数"> </el-table-column> -->
             <el-table-column label="操作" align="center" fixed="right" min-width="150">
                 <template slot-scope="{ row }">

+ 48 - 4
src/test/java/com/izouma/wenlvju/repo/RepoTest.java

@@ -2,6 +2,7 @@ package com.izouma.wenlvju.repo;
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.StrUtil;
+import com.alibaba.excel.util.FileUtils;
 import com.izouma.wenlvju.ApplicationTests;
 import com.izouma.wenlvju.domain.Collaborate;
 import com.izouma.wenlvju.domain.Organization;
@@ -9,9 +10,20 @@ import com.izouma.wenlvju.domain.Rate;
 import com.izouma.wenlvju.domain.RateAudit;
 import com.izouma.wenlvju.enums.RateStatus;
 import com.izouma.wenlvju.service.storage.StorageService;
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.List;
@@ -158,9 +170,41 @@ public class RepoTest extends ApplicationTests {
     }
 
     @Test
-    public void test3(){
-        double scores1 = (double) Math.round(79.55333 * 10) / 10;
-        System.out.println(scores1);
-        System.out.println(Math.round(79.333333 * 10) / 10);
+    public void test3() {
+
+        //需要解析的Excel文件
+        File file = new File("/Users/qiufangchao/Downloads/____.xlsx");
+        try {
+            //获取工作簿
+            InputStream fs = FileUtils.openInputStream(file);
+//            HSSFWorkbook workbook = new HSSFWorkbook(fs);
+//            XSSFWorkbook workbook = new XSSFWorkbook(fs);
+            Workbook wb = WorkbookFactory.create(fs);
+
+            //获取第一个工作表
+            Sheet hs = wb.getSheetAt(0);
+            //获取Sheet的第一个行号和最后一个行号
+            int last = hs.getLastRowNum();
+            int first = hs.getFirstRowNum();
+            //遍历获取单元格里的信息
+            for (int i = first; i < last; i++) {
+                Row row = hs.getRow(i);
+                int firstCellNum = row.getFirstCellNum();//获取所在行的第一个行号
+                int lastCellNum = row.getLastCellNum();//获取所在行的最后一个行号
+                for (int j = firstCellNum; j < lastCellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    //设置单元格类型
+                    String value = cell.toString();
+//                    String value = cell.getStringCellValue();
+                    System.out.print(value + " ");
+                }
+                System.out.println();
+            }
+        } catch (IOException | InvalidFormatException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+
+
     }
 }