| | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.yuanchu.mom.excel.HuTiaoData; |
| | | import com.yuanchu.mom.excel.TianXianData; |
| | | import com.yuanchu.mom.exception.ErrorException; |
| | | import com.yuanchu.mom.mapper.InsOrderStateMapper; |
| | | import com.yuanchu.mom.mapper.InsProductMapper; |
| | | import com.yuanchu.mom.mapper.InsProductResult2Mapper; |
| | | import com.yuanchu.mom.mapper.InsSampleMapper; |
| | | import com.yuanchu.mom.pojo.*; |
| | | import com.yuanchu.mom.service.InsOrderPlanService; |
| | | import com.yuanchu.mom.service.InsProductResult2Service; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.*; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | private InsProductMapper insProductMapper; |
| | | |
| | | @Resource |
| | | private InsSampleMapper insSampleMapper; |
| | | private InsProductResult2Mapper insProductResult2Mapper; |
| | | |
| | | @Resource |
| | | private InsProductResult2Mapper insProductResult2Mapper; |
| | | private InsProductResult2Service insProductResult2Service; |
| | | |
| | | @Resource |
| | | private InsOrderStateMapper insOrderStateMapper; |
| | | |
| | | //读åäºè°çæä»¶ |
| | | public void readDianLuFile1(Integer sampleId,InsOrderFile insOrderFile) { |
| | | List<InsProductResult2> insProductResult2s = new ArrayList<>(); |
| | | String excelFilePath = wordUrl + "/" + insOrderFile.getFileUrl(); // æ´æ°ä¸ºä½ çæä»¶è·¯å¾ |
| | | List<HuTiaoData> huTiaoData = readExcelData(excelFilePath); |
| | | //æ¥è¯¢è¯¥æ ·åçäºè°é¡¹ç®id |
| | | List<InsProduct> products = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() |
| | | List<HuTiaoData> huTiaoData = readExcelData1(excelFilePath); |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getState, 1) |
| | | .eq(InsProduct::getInsSampleId, sampleId) |
| | | .eq(InsProduct::getInspectionItemSubclass, "äºè°")); |
| | | .eq(InsProduct::getInsSampleId, sampleId)); |
| | | //æ¥è¯¢è¯¥æ ·åçäºè°é¡¹ç®id |
| | | List<InsProduct> products = insProducts.stream().filter(insProduct -> insProduct.getInspectionItemSubclass().equals("äºè°")).collect(Collectors.toList()); |
| | | if (ObjectUtils.isEmpty(products)) { |
| | | throw new ErrorException("è¯¥æ ·åæ²¡æäºè°é¡¹ç®"); |
| | | } |
| | | //æ¥è¯¢æ£éªä»»å¡id |
| | | List<InsOrderState> orderStates = insOrderStateMapper.selectList(Wrappers.<InsOrderState>lambdaQuery() |
| | | .eq(InsOrderState::getInsSampleId, sampleId) |
| | | .eq(InsOrderState::getLaboratory, "çµè·¯è¯éª")); |
| | | //æ¥è¯¢åææ£éªæ°æ® |
| | | List<InsProduct> productList = getInsProduct(sampleId, "çµè·¯è¯éª"); |
| | | List<InsProductResult2> result2s = insProductResult2Mapper.selectList(Wrappers.<InsProductResult2>lambdaQuery() |
| | | .eq(InsProductResult2::getNum, orderStates.get(0).getNum()) |
| | | .in(InsProductResult2::getInsProductId, insProducts.stream().distinct().map(InsProduct::getId).collect(Collectors.toList()))); |
| | | //List<InsProduct> productList = getInsProduct(sampleId, "çµè·¯è¯éª"); |
| | | //æ ¹æ®é¢ç¹åç±» |
| | | Map<String, List<HuTiaoData>> collect = huTiaoData.stream().collect(Collectors.groupingBy(HuTiaoData::getOften,LinkedHashMap::new, Collectors.toList())); |
| | | Map<String, List<HuTiaoData>> collect = huTiaoData.stream() |
| | | .collect(Collectors.groupingBy(HuTiaoData::getOften, LinkedHashMap::new, Collectors.toList())); |
| | | for (Map.Entry<String, List<HuTiaoData>> stringListEntry : collect.entrySet()) { |
| | | InsProductResult2 insProductResult2 = new InsProductResult2(); |
| | | insProductResult2.setOften(stringListEntry.getKey()+"(M)");//é¢ç¹ |
| | |
| | | //æ¬¡æ° |
| | | insProductResult2.setNum(orderStates.get(0).getNum()); |
| | | //颿®µ(å
夿忿°æ®æ¯å¦æ) |
| | | if (ObjectUtils.isNotEmpty(productList.get(0).getInsProductResult2())) { |
| | | insProductResult2.setFrequency(productList.get(0).getInsProductResult2().get(0).getFrequency()); |
| | | if (ObjectUtils.isNotEmpty(result2s)) { |
| | | List<String> list = result2s.stream().map(InsProductResult2::getFrequency).distinct().collect(Collectors.toList()); |
| | | for (String s : list) { |
| | | String[] mHzs = s.split("MHz")[0].split("-"); |
| | | //å夿è¿ä¸ªé¢ç¹æ¯å¦å¨é¢æ®µçèå´å
|
| | | if (Integer.parseInt(stringListEntry.getKey()) <= Integer.parseInt(mHzs[1]) && Integer.parseInt(stringListEntry.getKey()) >= Integer.parseInt(mHzs[0])) { |
| | | insProductResult2.setFrequency(s); |
| | | break; |
| | | } |
| | | insProductResult2Mapper.insert(insProductResult2); |
| | | } |
| | | if (ObjectUtils.isEmpty(insProductResult2.getFrequency())) { |
| | | throw new ErrorException("æ²¡ææ¾å°" + stringListEntry.getKey() + "对åºç颿®µ"); |
| | | } |
| | | } |
| | | insProductResult2s.add(insProductResult2); |
| | | } |
| | | insProductResult2Service.saveBatch(insProductResult2s); |
| | | } |
| | | |
| | | //读å天线çæä»¶ |
| | | public void readDianLuFile2(Integer sampleId, InsOrderFile insOrderFile) { |
| | | List<InsProductResult2> insProductResult2s = new ArrayList<>(); |
| | | String excelFilePath = wordUrl + "/" + insOrderFile.getFileUrl(); // æ´æ°ä¸ºä½ çæä»¶è·¯å¾ |
| | | List<TianXianData> tianXianData = readExcelData2(excelFilePath); |
| | | //æ¥è¯¢æ£éªä»»å¡id |
| | | List<InsOrderState> orderStates = insOrderStateMapper.selectList(Wrappers.<InsOrderState>lambdaQuery() |
| | | .eq(InsOrderState::getInsSampleId, sampleId) |
| | | .eq(InsOrderState::getLaboratory, "çµè·¯è¯éª")); |
| | | List<InsProduct> products = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getState, 1) |
| | | .eq(InsProduct::getInsSampleId, sampleId)); |
| | | //æ¥è¯¢è¯¥æ ·åççµå驻波æ¯é¡¹ç®id |
| | | List<InsProduct> products1 = products.stream().filter(insProduct -> insProduct.getInspectionItemSubclass().equals("çµå驻波æ¯")).collect(Collectors.toList()); |
| | | //æ¥è¯¢è¯¥æ ·åçåæåé离度项ç®id |
| | | List<InsProduct> products2 = products.stream().filter(insProduct -> insProduct.getInspectionItemSubclass().equals("åæåé离度")).collect(Collectors.toList()); |
| | | //æ¥è¯¢è¯¥æ ·åç弿åé离度项ç®id |
| | | List<InsProduct> products3 = products.stream().filter(insProduct -> insProduct.getInspectionItemSubclass().equals("弿åé离度")).collect(Collectors.toList()); |
| | | //æ¥è¯¢è¯¥æ ·åçå¹
度å差项ç®id |
| | | List<InsProduct> products4 = products.stream().filter(insProduct -> insProduct.getInspectionItemSubclass().equals("å¹
度åå·®")).collect(Collectors.toList()); |
| | | //æ¥è¯¢è¯¥æ ·åçæå¤§ç¸ä½å差项ç®id |
| | | List<InsProduct> products5 = products.stream().filter(insProduct -> insProduct.getInspectionItemSubclass().equals("æå¤§ç¸ä½åå·®")).collect(Collectors.toList()); |
| | | //è·åææé¢æ®µ,æ ¹æ®é¢æ®µè¿è¡åç±» |
| | | Map<String, List<TianXianData>> map = tianXianData.stream().collect(Collectors.groupingBy(TianXianData::frequency, LinkedHashMap::new, Collectors.toList())); |
| | | for (Map.Entry<String, List<TianXianData>> listEntry : map.entrySet()) { |
| | | //è·åä¿¡æ¯,æ ¹æ®æ£éªé¡¹ç®è¿è¡åç±» |
| | | Map<String, List<TianXianData>> collect = listEntry.getValue().stream().collect(Collectors.groupingBy(TianXianData::getName, LinkedHashMap::new, Collectors.toList())); |
| | | for (Map.Entry<String, List<TianXianData>> entry : collect.entrySet()) { |
| | | InsProductResult2 insProductResult2 = new InsProductResult2(); |
| | | if (entry.getKey().contains("驻波")) { |
| | | if (products1.size() <= 0) { |
| | | throw new ErrorException("çµå驻波æ¯é¡¹ç®æªæ¾å°"); |
| | | } |
| | | insProductResult2.setInsProductId(products1.get(0).getId());//çµåé©»æ³¢æ¯ |
| | | insProductResult2.setFrequency(listEntry.getKey());//颿®µ |
| | | insProductResult2.setAngle("0°");//è§åº¦ |
| | | insProductResult2.setNum(orderStates.get(0).getNum());//æ¬¡æ° |
| | | //è·åç«¯å£ |
| | | String port = entry.getValue().stream().map(TianXianData::getPort).collect(Collectors.joining(",")); |
| | | insProductResult2.setPort(port);//ç«¯å£ |
| | | //è·åæ£éªå¼ |
| | | String value = entry.getValue().stream().map(tianXianData1 -> "\"" + tianXianData1.getValue() + "\"").collect(Collectors.joining(",")); |
| | | insProductResult2.setValue("[[" + value + "]]");//å¼ |
| | | insProductResult2s.add(insProductResult2); |
| | | } else if (entry.getKey().contains("åæåé离") || entry.getKey().contains("ååé离")) { |
| | | if (products2.size() <= 0) { |
| | | throw new ErrorException("åæåéç¦»é¡¹ç®æªæ¾å°"); |
| | | } |
| | | insProductResult2.setInsProductId(products2.get(0).getId());//åæåé离 |
| | | insProductResult2.setFrequency(listEntry.getKey());//颿®µ |
| | | insProductResult2.setAngle("0°");//è§åº¦ |
| | | insProductResult2.setNum(orderStates.get(0).getNum());//æ¬¡æ° |
| | | //è·åç«¯å£ |
| | | String port = entry.getValue().stream().map(TianXianData::getPort).collect(Collectors.joining(",")); |
| | | insProductResult2.setPort(port);//ç«¯å£ |
| | | //è·åæ£éªå¼ |
| | | String value = entry.getValue().stream().map(tianXianData1 -> "\"" + tianXianData1.getValue() + "\"").collect(Collectors.joining(",")); |
| | | insProductResult2.setValue("[[" + value + "]]");//å¼ |
| | | insProductResult2s.add(insProductResult2); |
| | | } else if (entry.getKey().contains("弿åé离") || entry.getKey().contains("端å£é´é离")) { |
| | | if (products3.size() <= 0) { |
| | | throw new ErrorException("弿åéç¦»é¡¹ç®æªæ¾å°"); |
| | | } |
| | | insProductResult2.setInsProductId(products3.get(0).getId());//弿åé离 |
| | | insProductResult2.setFrequency(listEntry.getKey());//颿®µ |
| | | insProductResult2.setAngle("0°");//è§åº¦ |
| | | insProductResult2.setNum(orderStates.get(0).getNum());//æ¬¡æ° |
| | | //è·åç«¯å£ |
| | | String port = entry.getValue().stream().map(TianXianData::getPort).collect(Collectors.joining(",")); |
| | | insProductResult2.setPort(port);//ç«¯å£ |
| | | //è·åæ£éªå¼ |
| | | String value = entry.getValue().stream().map(tianXianData1 -> "\"" + tianXianData1.getValue() + "\"").collect(Collectors.joining(",")); |
| | | insProductResult2.setValue("[[" + value + "]]");//å¼ |
| | | insProductResult2s.add(insProductResult2); |
| | | } |
| | | } |
| | | } |
| | | /*å¹
度åç¸ä½éè¦å¦å¤ååè½*/ |
| | | //å
è¿æ»¤åºç«¯å£å·ä¸æ 为åå·®å¼çæ°æ® |
| | | List<TianXianData> dataList = tianXianData.stream().filter(tianXianData1 -> tianXianData1.getPort().equals("åå·®å¼")).collect(Collectors.toList()); |
| | | //åæ ¹æ®æ£éªé¡¹ç®è¿è¡åç» |
| | | Map<String, List<TianXianData>> collect = dataList.stream().collect(Collectors.groupingBy(TianXianData::getName, LinkedHashMap::new, Collectors.toList())); |
| | | for (Map.Entry<String, List<TianXianData>> entry : collect.entrySet()) { |
| | | if (entry.getKey().contains("å¹
度")) { |
| | | if (products4.size() <= 0) { |
| | | throw new ErrorException("å¹
度åå·®é¡¹ç®æªæ¾å°"); |
| | | } |
| | | Map<String, List<TianXianData>> listHashMap = new HashMap<>(); |
| | | for (TianXianData xianData : entry.getValue()) { |
| | | //è·å颿®µ(å
æ ¹æ®startåæ®µå¤æè¿ä¸ªé¢ç¹å¨åªä¸ªé¢æ®µä¹é´) |
| | | List<String> strings = map.keySet().stream().filter(s -> |
| | | !s.split("MHz")[0].split("-")[0].equals(s.split("MHz")[0].split("-")[1]) |
| | | ).collect(Collectors.toList()); |
| | | for (String s : strings) { |
| | | String[] mHzs = s.split("MHz")[0].split("-"); |
| | | //å夿è¿ä¸ªé¢ç¹æ¯å¦å¨é¢æ®µçèå´å
|
| | | if (Double.parseDouble(xianData.getStart()) <= Double.parseDouble(mHzs[1]) && Double.parseDouble(xianData.getStart()) >= Double.parseDouble(mHzs[0])) { |
| | | // æ£æ¥æ¯å¦å·²ç»åå¨è¿ä¸ªé®çæ¡ç® |
| | | List<TianXianData> xianDataList = listHashMap.getOrDefault(s, new ArrayList<>()); |
| | | // å°æ°æ®æ·»å å°å表ä¸ï¼è䏿¯è¦çæ§å¼ |
| | | xianDataList.add(xianData); |
| | | // å°æ´æ°åçå表æ¾åmapä¸ |
| | | listHashMap.put(s, xianDataList); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | for (Map.Entry<String, List<TianXianData>> listEntry : listHashMap.entrySet()) { |
| | | InsProductResult2 insProductResult2 = new InsProductResult2(); |
| | | insProductResult2.setInsProductId(products4.get(0).getId());//å¹
度åå·® |
| | | insProductResult2.setAngle("0°");//è§åº¦ |
| | | insProductResult2.setNum(orderStates.get(0).getNum());//æ¬¡æ° |
| | | insProductResult2.setFrequency(listEntry.getKey());//颿®µ |
| | | //è·åç«¯å£ |
| | | String port = listEntry.getValue().stream().map(tianXianData1 -> String.valueOf((int) Double.parseDouble(tianXianData1.getStart()))).collect(Collectors.joining(",")); |
| | | insProductResult2.setPort(port);//ç«¯å£ |
| | | //è·åæ£éªå¼ |
| | | String value = listEntry.getValue().stream().map(tianXianData1 -> "\"" + tianXianData1.getValue() + "\"").collect(Collectors.joining(",")); |
| | | insProductResult2.setValue("[[" + value + "]]");//å¼ |
| | | insProductResult2s.add(insProductResult2); |
| | | } |
| | | } else if (entry.getKey().contains("ç¸ä½")) { |
| | | if (products5.size() <= 0) { |
| | | throw new ErrorException("æå¤§ç¸ä½åå·®é¡¹ç®æªæ¾å°"); |
| | | } |
| | | Map<String, List<TianXianData>> listHashMap = new HashMap<>(); |
| | | for (TianXianData xianData : entry.getValue()) { |
| | | //è·å颿®µ(å
æ ¹æ®startåæ®µå¤æè¿ä¸ªé¢ç¹å¨åªä¸ªé¢æ®µä¹é´) |
| | | List<String> strings = map.keySet().stream().filter(s -> |
| | | !s.split("MHz")[0].split("-")[0].equals(s.split("MHz")[0].split("-")[1]) |
| | | ).collect(Collectors.toList()); |
| | | for (String s : strings) { |
| | | String[] mHzs = s.split("MHz")[0].split("-"); |
| | | //å夿è¿ä¸ªé¢ç¹æ¯å¦å¨é¢æ®µçèå´å
|
| | | if (Double.parseDouble(xianData.getStart()) <= Double.parseDouble(mHzs[1]) && Double.parseDouble(xianData.getStart()) >= Double.parseDouble(mHzs[0])) { |
| | | // æ£æ¥æ¯å¦å·²ç»åå¨è¿ä¸ªé®çæ¡ç® |
| | | List<TianXianData> xianDataList = listHashMap.getOrDefault(s, new ArrayList<>()); |
| | | // å°æ°æ®æ·»å å°å表ä¸ï¼è䏿¯è¦çæ§å¼ |
| | | xianDataList.add(xianData); |
| | | // å°æ´æ°åçå表æ¾åmapä¸ |
| | | listHashMap.put(s, xianDataList); |
| | | } |
| | | } |
| | | } |
| | | for (Map.Entry<String, List<TianXianData>> listEntry : listHashMap.entrySet()) { |
| | | InsProductResult2 insProductResult2 = new InsProductResult2(); |
| | | insProductResult2.setInsProductId(products5.get(0).getId());//æå¤§ç¸ä½åå·® |
| | | insProductResult2.setAngle("0°");//è§åº¦ |
| | | insProductResult2.setNum(orderStates.get(0).getNum());//æ¬¡æ° |
| | | insProductResult2.setFrequency(listEntry.getKey());//颿®µ |
| | | //è·åç«¯å£ |
| | | String port = listEntry.getValue().stream().map(tianXianData1 -> String.valueOf((int) Double.parseDouble(tianXianData1.getStart()))).collect(Collectors.joining(",")); |
| | | insProductResult2.setPort(port);//ç«¯å£ |
| | | //è·åæ£éªå¼ |
| | | String value = listEntry.getValue().stream().map(tianXianData1 -> "\"" + tianXianData1.getValue() + "\"").collect(Collectors.joining(",")); |
| | | insProductResult2.setValue("[[" + value + "]]");//å¼ |
| | | insProductResult2s.add(insProductResult2); |
| | | } |
| | | } |
| | | } |
| | | |
| | | Map<String, List<InsProductResult2>> groupedMap = insProductResult2s.stream() |
| | | .collect(Collectors.groupingBy(item -> item.getInsProductId() + "_" + item.getFrequency())); |
| | | // è¿æ»¤åºåç»åæ°éçäº1çç» |
| | | List<InsProductResult2> filteredList = groupedMap.values().stream() |
| | | .filter(list -> list.size() == 1) |
| | | .flatMap(List::stream) |
| | | .collect(Collectors.toList()); |
| | | for (Map.Entry<String, List<InsProductResult2>> entry : groupedMap.entrySet()) { |
| | | if (entry.getValue().size() > 1) { |
| | | InsProductResult2 result2 = new InsProductResult2(); |
| | | result2.setInsProductId(Integer.parseInt(entry.getKey().split("_")[0])); |
| | | result2.setFrequency(entry.getKey().split("_")[1]); |
| | | result2.setPort(entry.getValue().stream().map(InsProductResult2::getPort).collect(Collectors.joining(","))); |
| | | String value = entry.getValue().stream().map(insProductResult2 -> { |
| | | return insProductResult2.getValue().replace("[[", "").replace("]]", ""); |
| | | }).collect(Collectors.joining(",")); |
| | | result2.setValue("[[" + value + "]]"); |
| | | result2.setAngle("0°"); |
| | | result2.setOften(entry.getValue().stream().map(InsProductResult2::getOften).collect(Collectors.joining(","))); |
| | | filteredList.add(result2); |
| | | } |
| | | } |
| | | System.out.println(filteredList); |
| | | //insProductResult2Service.saveBatch(filteredList); |
| | | } |
| | | |
| | | public static List<HuTiaoData> readExcelData(String filePath) { |
| | | |
| | | public static List<HuTiaoData> readExcelData1(String filePath) { |
| | | List<HuTiaoData> dataList = new ArrayList<>(); |
| | | |
| | | // åå§åçå¬å¨ |
| | |
| | | return dataList; |
| | | } |
| | | |
| | | public List<InsProduct> getInsProduct(Integer id, String laboratory) { |
| | | List<InsProduct> insProducts = new ArrayList<>(); |
| | | //æ ·å |
| | | insProducts = insSampleMapper.getInsProduct1(id, laboratory); |
| | | if (insProducts.size() == 0) { |
| | | insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, id) |
| | | .eq(InsProduct::getState, 1) |
| | | .eq(InsProduct::getSonLaboratory, laboratory)); |
| | | for (InsProduct insProduct : insProducts) { |
| | | List<InsProductResult2> insProductResult2List = insProductResult2Mapper.selectList(Wrappers.<InsProductResult2>lambdaQuery() |
| | | .eq(InsProductResult2::getInsProductId, insProduct.getId()).isNull(InsProductResult2::getNum)); |
| | | insProduct.setInsProductResult2(insProductResult2List); |
| | | public static List<TianXianData> readExcelData2(String filePath) { |
| | | List<TianXianData> dataList = new ArrayList<>(); |
| | | |
| | | // åå§åçå¬å¨ |
| | | AnalysisEventListener<TianXianData> listener = new AnalysisEventListener<TianXianData>() { |
| | | @Override |
| | | public void invoke(TianXianData data, AnalysisContext context) { |
| | | // å¤çæ¯è¡æ°æ®ï¼è¿éç®åå°æ·»å å°æ°æ®åè¡¨ä¸ |
| | | dataList.add(data); |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext context) { |
| | | // æææ°æ®è§£æå®æåçæä½ï¼è¿éæä¸å®ç° |
| | | } |
| | | }; |
| | | |
| | | try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(filePath), "GB2312")); |
| | | Workbook workbook = new XSSFWorkbook(); |
| | | FileOutputStream fileOut = new FileOutputStream(filePath.replace("csv", "xlsx"))) { |
| | | Sheet sheet = workbook.createSheet("Sheet1"); |
| | | String line; |
| | | int rowNum = 0; |
| | | while ((line = reader.readLine()) != null) { |
| | | Row row = sheet.createRow(rowNum++); |
| | | String[] columns = line.split(","); |
| | | for (int i = 0; i < columns.length; i++) { |
| | | Cell cell = row.createCell(i); |
| | | cell.setCellValue(columns[i]); |
| | | } |
| | | } |
| | | return insProducts; |
| | | workbook.write(fileOut); |
| | | System.out.println("CSV æä»¶å·²æå转æ¢ä¸º Excel æä»¶"); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | // 读åExcelæä»¶ |
| | | EasyExcel.read(filePath.replace("csv", "xlsx"), TianXianData.class, listener).sheet().headRowNumber(-1).doRead(); |
| | | return dataList; |
| | | } |
| | | |
| | | } |