`

导入xlsx

 
阅读更多

1-maintainWmsItemPage.wf.xml

 

<?xml version="1.0" encoding="UTF-8"?>
<page id="maintainWmsItemPage">
    <main>
        <process id="boxTypeProcess">
        		<tablePopup id="importItems" title="importItems" 
				process="boxTypeProcess.import" enableType="none" 
				containId="false" pageId="editImportItemsPage">
                <enableExpression/>
            </tablePopup>
        </process>
    </main>
    <detail/>
</page

 

 

2-editImportItemsPage.xml

 

<?xml version="1.0" encoding="UTF-8"?>
<pages>
    <editPage id="editImportItemsPage" title="editImportItemsPage">
        <workflow/>
        <initListeners/>
        <inputUIs>
            <file id="omsOrder.importFile" title="filePath" row="1" col="1" span="1" 
			readOnly="false" required="true" reserve="false" forceOverride="true" 
			focusUI="false" inVisible="false" showImage="false" fileSize="22577152">
                <visibleExpression/>
                <hql/>
                <eventListeners/>
            </file>
        </inputUIs>
    </editPage>
</pages>

 

 

3-editImportItemsPage.wf.xml

 

<?xml version="1.0" encoding="UTF-8"?>
<page id="editImportItemsPage">
    <main>
        <process id="boxTypeProcess">
            <formCommit id="importItems" title="importItems" 
			process="boxTypeProcess.import" enableType="none" 
			multiMapping="false" download="false" closeTransactional="true" 
			confirmMessage="confirm" visibleType="none">
                <enableExpression/>
                <mappings>
                     <mapping id="omsOrder.importFile" className="file">
                        <entries/>
                    </mapping>
                </mappings>
                <actions>
                    <action managerName="noTransactionManager" 
					methodName="importItem" parameter="omsOrder.importFile"/>
                </actions>
                <forwards>
                    <forward name="refreshParent" newEnabled="true" editEnabled="true"/>
                </forwards>
            </formCommit>
        </process>
    </main>
    <detail/>
</page>

 

 

NoTransactionManagerImp.java

 

/**
 * @author yc min
 */
public class NoTransactionManagerImp extends DefaultBaseManager 
	implements NoTransactionManager{
	
	/**
	 * 导入物料信息
	 * @param file
	 */
	public void importItem(File file) {
		// 判断文件是否存在
		if (file == null) {
			throw new BusinessException("操作失败,未找对应文件!");
		}
		// 验证文件格式
		String name = file.getName();
		String suffix = name.substring(name.lastIndexOf(".") + 1,
				name.lastIndexOf(".") + 5);
		if (!suffix.equals("xlsx")) {
			throw new BusinessException("操作失败,导入文件格式错误!");
		}
		
		FileInputStream fileInput = null;
		 XSSFWorkbook xwb = null;
		 try {
			 fileInput = new FileInputStream(file);
			 xwb = new XSSFWorkbook(fileInput);
			 XSSFSheet sheet = xwb.getSheetAt(0);
			 createItem(sheet);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}finally {
			try {
				if(fileInput != null){
					fileInput.close();
					fileInput = null;
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
			
			if(xwb != null){
				xwb = null;
			}
		}
	}
	/**
	 * 创建物料
	 * @param sheet
	 */
	@SuppressWarnings("unchecked")
	private void createItem(XSSFSheet sheet) {
		StringBuffer bufferLog = new StringBuffer();
		
		WmsLotRule wmsLotRule = null;
		//获取批次规则
		List<WmsLotRule> list = (List<WmsLotRule>)commonDao.
			findByQuery("FROM WmsLotRule rule"
				+ " WHERE rule.status = :status", "status", BaseStatus.ENABLED);
		if(list.isEmpty() || list.size() > 1){
			bufferLog.append("操作失败,未找到唯一的批次规则!\n");
		}else{
			wmsLotRule = list.get(0);
		}
		Map<String,WmsOrganization> sups = 
			new HashMap<String, WmsOrganization>();
		Map<String,WmsItemType> itemType = 
			new HashMap<String, WmsItemType>();
		Map<String,WmsSimilarCode> similars = 
			new HashMap<String, WmsSimilarCode>();
		List<Object[]> items = new ArrayList<Object[]>();
		String secondUnit = "箱";
		for(int i = 2; i <= sheet.getLastRowNum()+1; i ++){
			try {
				XSSFRow row = sheet.getRow(i-1);
				if(row == null){
					continue;
				}
				WmsItem item = null;
				String itemCode = getValue(row.getCell(0));
				if(StringUtils.isEmpty(itemCode)){
					bufferLog.append(
						"操作失败,["+i+"]行,物料编码不能为空!\n");
					continue;
				}else{
					if(StringUtils.isEmpty(itemCode)){
						bufferLog.append(
							"操作失败,["+i+"]行,物料编码不能为空!\n");
					}
					item = (WmsItem) commonDao.findByQueryUniqueResult
						("FROM WmsItem item WHERE item.code =:itemCode", 
							new String[]{"itemCode"}, new Object[]{itemCode});
					if(item == null){
						item = EntityFactory.getEntity(WmsItem.class);
					}
				}
				String name = getValue(row.getCell(1));
				String packageBoxType = getValue(row.getCell(20));
				if(StringUtils.isEmpty(name)){
					bufferLog.append(
						"操作失败,["+i+"]行,物料名称不能为空!\n");
				}
				String ename = getValue(row.getCell(2));
				String type = getValue(row.getCell(3));
				String typeValue = "";
				if(!StringUtils.isEmpty(type)){
					if("A".equals(type)){
						typeValue = WmsItemCategory.A;
					}else if("C".equals(type)){
						typeValue = WmsItemCategory.C;
					}else if("I".equals(type)){
						typeValue = WmsItemCategory.I;
					}else{
						typeValue = WmsItemCategory.HOMEMADE;
					}
				}
		        
				String itemTypeCode1 = getValue(row.getCell(4));
				String itemTypeCode2 = getValue(row.getCell(5));
				
				WmsItemType itemType1 = null;
				WmsItemType itemType2 = null;
				
				if(StringUtils.isEmpty(itemTypeCode1) 
					&& StringUtils.isEmpty(itemTypeCode2)){
					bufferLog.append(
						"操作失败,["+i+"]行套分类、散件分类不能同时为空!");
				}
				if(StringUtils.isNotEmpty(itemTypeCode1)){
					if(itemType.containsKey(itemTypeCode1)){
						itemType1 = itemType.get(itemTypeCode1);
					}else{
						itemType1 = (WmsItemType) commonDao.
							findByQueryUniqueResult("FROM WmsItemType itmeType"
								+ " WHERE itmeType.code=:code", 
								"code", itemTypeCode1);
						itemType.put(itemTypeCode1, itemType1);
					}
					if(itemType1 == null){
						bufferLog.append("操作失败,["+i+"]
							行散件物料分类["+itemTypeCode1+"]不存在!\n");
					}
				}

				if(StringUtils.isNotEmpty(itemTypeCode2)){
					if(itemType.containsKey(itemTypeCode2)){
						itemType2 = itemType.get(itemTypeCode2);
					}else{
						itemType2 = (WmsItemType) commonDao.
							findByQueryUniqueResult("FROM WmsItemType itmeType"
								+ " WHERE itmeType.code=:code", 
								"code", itemTypeCode2);
						itemType.put(itemTypeCode2, itemType2);
					}
					if(itemType2 == null){
						bufferLog.append("操作失败,["+i+"]
							行台套物料分类["+itemTypeCode2+"]不存在!\n");
					}
				}

				String beBom = getValue(row.getCell(6));
				boolean beBomFlag = false;
				if(StringUtils.isEmpty(beBom)){
					bufferLog.append(
						"操作失败,["+i+"]行是否套件不能为空!\n");
				}else{
					beBomFlag = beBom.equals("是")?Boolean.TRUE : Boolean.FALSE;
				}
				
				String leftRightPart = getValue(row.getCell(7));
				
				String similarCode = getValue(row.getCell(8));
				WmsSimilarCode similar = null;
				if(!StringUtils.isEmpty(similarCode)){
					if(similars.containsKey(similarCode)){
						similar = similars.get(similarCode);
					}else{
						similar = (WmsSimilarCode)commonDao.
						findByQueryUniqueResult(
						"FROM WmsSimilarCode similarCode"
								+ " WHERE similarCode.code=:code",
								"code", similarCode);
						similars.put(similarCode, similar);
					}
					if(similar == null){
						bufferLog.append("操作失败,["+i+"]
						行相似编码["+similarCode+"]不存在!\n");
					}
				}
				
				String highConcern = getValue(row.getCell(9));
				String highClaims = getValue(row.getCell(10));
				String highValue = getValue(row.getCell(11));
				
				String supplierCode = getValue(row.getCell(16));
				WmsOrganization supplier = null;
				
				if(StringUtils.isEmpty(supplierCode)){
					bufferLog.append("操作失败,
						["+i+"]行供应商编码不能为空!\n");
					System.out.println(row.getCell(0));
				}else{
					if(!sups.containsKey(supplierCode)){
						supplier = (WmsOrganization)commonDao.
							findByQueryUniqueResult(
							"FROM WmsOrganization supplier"
								+ " WHERE supplier.code=:code"
								+ " AND supplier.beSupplier = true", 
								"code", supplierCode);
						sups.put(supplierCode, supplier);
					}else{
						supplier = sups.get(supplierCode);
					}
					if(supplier == null){
						bufferLog.append("操作失败,["+i+"]
						行供应商编码["+supplierCode+"]不存在\n");
					}
				}
				
				boolean beLawCheck = false;
				if(row.getCell(17) != null){
					beLawCheck = getValue(row.getCell(17)).
						equals("是") ? Boolean.TRUE : Boolean.FALSE;
				}
				
				boolean beOutPackage = false;
				if(row.getCell(18) != null){
					beOutPackage = getValue(row.getCell(18)).
						equals("是") ? Boolean.TRUE : Boolean.FALSE;
				}
				
				String unit = getValue(row.getCell(12));
				if(StringUtils.isEmpty(unit)){
					bufferLog.append("操作失败,
						["+i+"]行单位名称不能为空!\n");
				}
				
				String weightStr = getValue(row.getCell(15));
				double weight = 0.0;
				if(StringUtils.isEmpty(weightStr)){
					bufferLog.append("操作失败,
						["+i+"]行物料单重不能为空!\n");
				}else{
					weight = getNumbericValue(row.getCell(15));
				}
				
				String convertFigureStr = getValue(row.getCell(14));
				int convertFigure = 0;
				if(StringUtils.isEmpty(convertFigureStr)){
					bufferLog.append("操作失败,
						["+i+"]行标装数量不能为空!\n");
				}else{
					convertFigure = 
						Integer.valueOf(getValue(row.getCell(14)));
				}
				
				String supplierOutStr =getValue(row.getCell(19));
				WmsOrganization supplierOut = null;
				if (!StringUtils.isEmpty(supplierOutStr)) {
					if(sups.containsKey(supplierOutStr)){
						supplierOut = sups.get(supplierOutStr);
					}else{
						String hql = "FROM WmsOrganization "+
							" supplier WHERE 1=1"+ 
							" AND supplier.beSupplier = true"
							+ " AND (supplier.code =:code"
							+" OR supplier.name =:name) ";
						supplierOut = (WmsOrganization) 
							this.commonDao.findByQueryUniqueResult(hql, 
								new String[]{"code","name"}, 
								new Object[]{supplierOutStr,supplierOutStr});
						sups.put(supplierOutStr, supplierOut);
					}
					if (supplierOut == null) {
						bufferLog.append("操作失败["+i+"]行委外供应商
							【"+ supplierOutStr +"】在系统中未维护!\n");
					}
				}
				Integer containTime = null;
				if(!StringUtils.isEmpty(getValue(row.getCell(21)))){
					try{
						containTime = 
						Integer.valueOf(getValue(row.getCell(21)));
					}catch(Exception e){
						bufferLog.append("操作失败,["+i+"]行物料容忍度
						【"+ row.getCell(21) +"】是数字!\n");
					}		
				}
				
				boolean beScreening = false;
				if(row.getCell(22) != null){
					beScreening = getValue(row.getCell(22)).
						equals("是") ? Boolean.TRUE : Boolean.FALSE;
				}
				
				boolean beAntirust = false;
				if(row.getCell(23) != null){
					beAntirust = getValue(row.getCell(23)).
						equals("是") ? Boolean.TRUE : Boolean.FALSE;
				}
				
				boolean beShockproof = false;
				if(row.getCell(24) != null){
					beShockproof = getValue(row.getCell(24)).
						equals("是") ? Boolean.TRUE : Boolean.FALSE;
				}
				
				int rustDay = 0;
				if(!StringUtils.isEmpty(getValue(row.getCell(25)))){
					try{
						rustDay = Integer.valueOf(getValue(row.getCell(25)));
					}catch(Exception e){
						bufferLog.append("操作失败,["+i+"]行防锈周期
						【"+ row.getCell(25) +"】是数字!\n");
					}		
				}
				
				WmsPackageUnit pu1 =null;
				if(item.isNew()){
					pu1 = EntityFactory.getEntity(WmsPackageUnit.class);
				}else{
					pu1 = (WmsPackageUnit) commonDao.
						findByQueryUniqueResult("FROM WmsPackageUnit p"
								+ " WHERE p.item.code =:code AND p.lineNo = 1", 
								new String[]{"code"}, new Object[]{itemCode});
					if(pu1==null){
						pu1 = EntityFactory.getEntity(WmsPackageUnit.class);
					}
				}
				WmsPackageUnit pu2 = null;
				if(!secondUnit.endsWith(unit)){
					if(item.isNew()){
						pu2 = EntityFactory.getEntity(WmsPackageUnit.class);
					}else{
						pu2 = (WmsPackageUnit) commonDao.
							findByQueryUniqueResult("FROM WmsPackageUnit p"
								+ " WHERE p.item.code =:code AND p.lineNo = 2 ", 
								new String[]{"code"}, new Object[]{itemCode});
						if(pu2==null){
							pu2 = EntityFactory.getEntity(WmsPackageUnit.class);
						}
					}
				}
				
				if(bufferLog.length() == 0){
					Object[] obj = new Object[]{item,
							itemCode,name,ename,typeValue,
							itemType1,itemType2,beBomFlag,leftRightPart,
							similar,highConcern,highClaims,highValue,
							supplier,beLawCheck,beOutPackage,wmsLotRule,
							supplierOut,containTime,beScreening,beAntirust,
							beShockproof,rustDay,packageBoxType,pu1,unit,weight,
							pu2,secondUnit,convertFigure
					};
					
					items.add(obj);
				}
			} catch (Exception e) {
				bufferLog.append("操作失败,["+i+"]行格式错误,请检查!\n");
			}
		}
		
		sups.clear();itemType.clear();similars.clear();
		if(bufferLog.length() > 0){
			ExceptionLog log = new ExceptionLog(
				UserHolder.getUser(), "maintainWmsItemPage.xml", 
					"importItem", bufferLog.toString());
			commonDao.store(log);
		}else{
			WmsItemManager wmsItemManager = (WmsItemManager) 
				applicationContext.getBean("wmsItemManager");
			int PAGE_NUMBER = 100;
			int size = items.size();
			int j = MyUtils.getSize(size, PAGE_NUMBER);
			for(int k=0 ; k<j ; k++){
				int toIndex = MyUtils.getIndex(k, size, PAGE_NUMBER);
				List<Object[]> ret = MyUtils.getListObj(
					items, k, toIndex, PAGE_NUMBER);
				Object[] obj = new Object[]{
						ret
				};
				wmsItemManager.createItem(obj);
				System.out.println("total:"+j+",going:"+(k+1));
			}
		}
	}
	private Double getNumbericValue(XSSFCell cell){
		Double value = 0D;
		if(cell == null){
			return value;
		}
		try {
			if(cell.getCellType() == Cell.CELL_TYPE_NUMERIC){
				value = cell.getNumericCellValue();
			}
		} catch (Exception e) {
			value = 0D;
		}
		return value;
	}
	/**
	 *按照字符方式获取Excel表中的值
	 * @param cell
	 * @return
	 */
	private String getValue(XSSFCell cell){
		String value = "";
		if(cell == null){
			return value;
		}
		if(cell.getCellType() == Cell.CELL_TYPE_NUMERIC){
			DecimalFormat df = new DecimalFormat("0"); 
			value = df.format(cell.getNumericCellValue());
		}else if(cell.getCellType() == Cell.CELL_TYPE_STRING){
			value = cell.getStringCellValue();
		}else if(cell.getCellType() == Cell.CELL_TYPE_BLANK){
			return value;
		}
		return value.trim();
	}
}

 

 

DefaultWmsItemManager.java

 

@SuppressWarnings("unchecked")
public class DefaultWmsItemManager extends 
	DefaultBaseManager implements WmsItemManager {
	
	public void createItem(Object[] obj){
		List<Object[]> items = (List<Object[]>) obj[0];
		for(Object[] excel : items){
			WmsItem item = (WmsItem) excel[0];
			 
			 if(item.isNew()){
				 item.setCode(excel[1].toString());
			 }
			 item.setName(excel[2].toString());
			 item.setEname(excel[3].toString());
			 item.setType(excel[4].toString());
			 item.setItemType1((WmsItemType)excel[5]);
			 item.setItemType2((WmsItemType)excel[6]);
			 item.setBeBOM(Boolean.valueOf(excel[7].toString()));
			 item.setLeftRightPart(excel[8].toString());
			 item.setSimilarCode((WmsSimilarCode)excel[9]);
			 item.setHighConcern(excel[10].toString());
			 
			 item.setHighClaims(excel[11].toString());
			 item.setHighValue(excel[12].toString());
			 item.setSupplier((WmsOrganization)excel[13]);
			 item.setBeLawCheck(Boolean.valueOf(excel[14].toString()));
			 item.setBeOutPackage(Boolean.valueOf(excel[15].toString()));
			 item.setLotRule((WmsLotRule)excel[16]);
			 item.setSupplierOut((WmsOrganization)excel[17]);
			 item.setContainTime(excel[18]==null?0:
				Integer.valueOf(excel[18].toString()));
			 item.setBeScreening(Boolean.valueOf(excel[19].toString()));
			 item.setBeAntirust(Boolean.valueOf(excel[20].toString()));
			 
			 item.setBeShockproof(Boolean.valueOf(excel[21].toString()));
			 item.setRustDay(excel[22]==null?0:
				Integer.valueOf(excel[22].toString()));
			 //设置箱型
			 item.setPackageBoxType(excel[23].toString());
			 item.setStatus(BaseStatus.ENABLED);
			 commonDao.store(item);
			 
			 WmsPackageUnit pu1 = (WmsPackageUnit) excel[24];
			 pu1.setLineNo(1);
			 pu1.setUnit(excel[25].toString());
			 pu1.setConvertFigure(1);
			 pu1.setWeight(Double.valueOf(excel[26].toString()));
			 pu1.setItem(item);
			 commonDao.store(pu1);
			 
			 WmsPackageUnit pu2 = (WmsPackageUnit) excel[27];
			 if(pu2!=null){
				 pu2.setLineNo(2);
				 pu2.setUnit(excel[28].toString());
				 pu2.setConvertFigure(Integer.valueOf(excel[29].toString()));
				 pu2.setItem(item);
				 commonDao.store(pu2);
			 }
		}
	}
}

 

 

MyUtils.java

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**yc min*/
public class MyUtils {
	private static Log log = LogFactory.getLog(MyUtils.class);
	public static SimpleDateFormat yy = 
	new SimpleDateFormat("yyyyMMdd");
	/**####*/
	public static String spilt4 = "####";
	 public static int getSize(int size,int PAGE_NUMBER){  
        int j = size / PAGE_NUMBER;  
        if((size % PAGE_NUMBER) > 0){  
            j += 1;  
        }  
        return j;  
    }  
    public static int getIndex(int k,int size,int PAGE_NUMBER){  
        int toIndex = ((k + 1) * PAGE_NUMBER);  
        if(toIndex > size){  
            toIndex = size;  
        }  
        return toIndex;  
    }  
    public static List<Object> getList(
		List<Object> list,int k,int toIdnex,int PAGE_NUMBER){  
        List<Object> ret = list.subList((k * PAGE_NUMBER), toIdnex);  
        return ret;  
    }  
    public static List<Object[]> getListObj(
		List<Object[]> list,int k,int toIndex,int PAGE_NUMBER){  
        List<Object[]> ret = list.subList((k * PAGE_NUMBER), toIndex);  
        return ret;  
    }
    /**return string(yyyyMMdd)*/
    public static String formatDateYYToStr(Date date) {
		try {
			return yy.format(date);
		} catch (Exception e) {
			log.debug("MyUtils.formatDateYYToStr():" + e.getMessage());
			return null;
		}

	}
}

 

分享到:
评论

相关推荐

    php导入xls,php导入xlsx文件,php导入,phpExce

    标题和描述提及的“php导入xls,php导入xlsx文件,php导入,phpExcel”涉及了PHP处理Excel文件的一些关键知识点。以下是关于这些主题的详细说明。 1. PHP导入XLS文件: - XLS文件是早期版本的Microsoft Excel(97-...

    Navvicat导入xlsx需要的插件

    Navvicat导入xlsx需要的插件,Navvicat导入xlsx需要的插件,Navvicat导入xlsx需要的插件

    前端导出-导入xlsx.7z

    "前端导出-导入xlsx.7z"是一个压缩包,它包含了实现前端对XLSX文件进行导入和导出的示例代码或库。在这个场景下,我们将主要讨论如何利用`xlsx-style`库来完成这一任务。 `xlsx-style`是一个强大的JavaScript库,...

    struts1 poi Excel批量导入支持xls和xlsx-源码java

    在本项目中,"struts1 poi Excel批量导入支持xls和xlsx"是一个基于Struts1和POI实现的功能,它允许用户批量导入Excel数据,无论是旧版的.xls格式还是较新的.xlsx格式。 首先,我们需要了解Apache POI的基本用法。...

    struts2 poi 导入xls xlsx 绝对兼容

    以上就是关于"Struts2 poi 导入xls xlsx 绝对兼容"的相关知识点,通过Struts2和Apache POI的结合,开发者可以轻松地在Java Web应用中处理Excel文件,实现数据的导入和导出功能,提高工作效率。在实际项目中,可以...

    eclipse导入导出excel-xlsx

    导入XLSX文件: 1. 创建一个新的Java类,例如`ExcelReader`,并导入Apache POI的相关类,如`XSSFWorkbook`, ` XSSFSheet`, `XSSFRow`, 和 `XSSFCell`。 2. 使用`FileInputStream`打开XLSX文件,创建`XSSFWorkbook`...

    java读取execl(xls,xlsx)

    在实际开发中,读取Excel文件常用于数据导入、报表自动化生成、数据分析等场景。例如,可以使用Java程序从Excel文件中读取用户数据,然后批量插入数据库,或者将数据库查询结果导出到Excel文件,便于用户查看和分析...

    EXCEL导入页面TABLE

    在现代Web应用中,数据的导入与展示是常见的功能需求,尤其在数据分析和管理领域。本主题"EXCEL导入页面TABLE"聚焦于如何利用JavaScript(JS)技术将Excel文件的内容读取并转换为网页上的表格(TABLE)进行展示。这...

    python工具-excel批量导入mysql (几千万数据半小时可搞定)

    本篇文章将详细讲解如何利用Python工具实现Excel数据的批量导入到MySQL数据库,以及如何优化这一过程,使得几千万的数据能够在半小时内完成导入。 首先,我们需要了解Python中用于操作Excel的主要库——pandas。...

    Delphi中从Excel导入数据的通用方法

    在Delphi编程环境中,从Excel导入数据是一项常见的需求,尤其在数据分析、报表处理或数据库集成等场景下。本文将详细探讨如何实现这个功能,并提供一个通用的方法。 首先,要完成这个任务,我们需要一个能与Excel...

    asp上传并导入EXCEL文件

    在ASP(Active Server Pages)开发中,经常需要处理文件上传和数据导入的功能,特别是与Excel文件交互时。本文将深入探讨如何使用ASP实现Excel文件的上传,并将其数据导入到Access数据库中。 首先,我们需要理解ASP...

    matlab导入xlsx数据代码步骤-rest_pipeline:使用CONN的静息态fMRI分析管道

    matlab导入xlsx数据代码一步一步使用 CONN (rest_pipeline) 的静息状态 fMRI 分析管道 此代码仅用于我们的实验室,但请随时查看它以及我如何使用 CONN 的批处理功能。 介绍 这个 MATLAB 管道基于 CONN(功能连接工具...

    C#Winform使用NPOI导入Excel数据

    在本文中,我们将深入探讨如何使用C# Winform应用程序结合NPOI库来实现Excel数据的导入功能。NPOI是一个强大的.NET库,允许开发者读取、写入Microsoft Office文件格式,包括Excel。通过NPOI,我们可以轻松处理Excel...

    读取百万级数据量的xlsx文件的java代码

    该代码可以处理100万数据量的excel文件,xlsx文件数据量太大,用普通的读法会报内存溢出错误,所以用官网提供的方法,一条一条的读取大excel文件,本例子从这点出发,组装excel里读取的单条数据为list,在根据需求...

    利用ADO将EXCEL批量导入至ACCESS中

    strFile = "C:\路径\你的Excel文件.xlsx" ' 创建Excel工作簿连接字符串 strCon = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & strFile & _ ";Extended Properties=""Excel 12.0 Xml;HDR=YES"";" '...

    excel表导入数据库 数据库导出excel(idea平台)

    在IT行业中,数据的导入与导出是常见的数据处理任务,尤其在数据分析、报表生成以及系统集成等场景中。Excel作为流行的电子表格工具,经常需要与数据库进行交互,以实现数据的交换。在这个主题中,我们将深入探讨...

    利用plsql把excel的数据批量导入oracle数据库的顺序.docx

    在这里,找到并选择你准备好的Excel文档,通常以.xlsx或.xls格式存在。 步骤四,系统会加载Excel文件,并显示可供导入的sheet列表。你可以预览数据,确保选择正确的sheet。 步骤五,切换到“到Oracle的数据”页面...

    xls导入access

    当我们需要将大量的数据从Excel(XLS格式)文件导入到Access时,这是一项常见的操作,特别是在进行数据整合、分析或者构建复杂数据库时。 **Excel(XLS)文件** XLS是Microsoft Excel早期版本(97-2003)使用的文件...

    盘点工具2-存货盘点表.xlsx

    盘点工具2-存货盘点表

    C#使用NPOI对Excel文档进行读、写、导入、导出等操作的dll最新版2.5.1+2.3.0

    C#使用开源NPOI在没有安装Office的情况下对Excel文档进行读、写、导入、导出等操作。dll最新版2.5.1,支持.NET4.0 /.NET4.5以及v2.3.0(最后一个支持.NET2.0的版本)。

Global site tag (gtag.js) - Google Analytics