蔡德晨 5 gadi atpakaļ
vecāks
revīzija
699e8699ba

+ 29 - 0
src/main/java/com/jeeplus/common/utils/excel/ImportExcel.java

@@ -141,6 +141,11 @@ public class ImportExcel {
 		this(multipartFile.getOriginalFilename(), multipartFile.getInputStream(), headerNum, sheetName);
 	}
 
+	public ImportExcel(MultipartFile multipartFile, int headerNum, String[] sheetName)
+			throws InvalidFormatException, IOException {
+		this(multipartFile.getOriginalFilename(), multipartFile.getInputStream(), headerNum, sheetName);
+	}
+
 	/**
 	 * 构造函数
 	 * @param path 导入文件对象
@@ -187,6 +192,30 @@ public class ImportExcel {
 		log.debug("Initialize success.");
 	}
 
+
+	public ImportExcel(String fileName, InputStream is, int headerNum, String[] sheetName)
+			throws InvalidFormatException, IOException {
+		int i = 0;
+		if (StringUtils.isBlank(fileName)){
+			throw new RuntimeException("导入文档为空!");
+		}else if(fileName.toLowerCase().endsWith("xls")){
+			this.wb = new HSSFWorkbook(is);
+		}else if(fileName.toLowerCase().endsWith("xlsx")){
+			this.wb = new XSSFWorkbook(is);
+		}else{
+			throw new RuntimeException("文档格式不正确!");
+		}
+		for(int j=0;j<sheetName.length;j++){
+			if(this.wb.getSheet(sheetName[j]) != null ){
+                  i=j;
+                  break;
+			}
+		}
+		this.sheet = this.wb.getSheet(sheetName[i]);
+		this.headerNum = headerNum;
+		log.debug("Initialize success.");
+	}
+
 //	public ImportExcel(MultipartFile file,int headerNum,String sheetName) throws IOException {
 //		String fileName = file.getOriginalFilename();
 //		InputStream is = file.getInputStream();

+ 3 - 3
src/main/java/com/jeeplus/modules/sg/overheadline/service/OverheadLineService.java

@@ -96,7 +96,7 @@ public class OverheadLineService {
                jkxlDetailFee.setAzFee(azTotal);
                jkxlDetailFee.setQtFee(otherTotal);
            }
-           if(jkxlDetailFee.getWbsCode().equals("44000000")){
+           if(jkxlDetailFee.getWbsCode().equals("44000000") || jkxlDetailFee.getWbsCode().equals("34000000")){
                jkxlDetailFee.setTotalFee(qtTotal);
 
            }
@@ -158,7 +158,7 @@ public class OverheadLineService {
        ImportExcel qt = new ImportExcel(file,1,BashInfo.SHEET_QTFY);  //其他项目清单计价表
        ImportExcel total = new ImportExcel(file,1,BashInfo.SHEET_HZB );  //工程项目竣工结算汇总表
        ImportExcel gzhz = new ImportExcel(file,1,BashInfo.SHEET_GCHZ );   //架空线路工程费用汇总
-       ImportExcel fbrcg = new ImportExcel(file,1,BashInfo.SHEET_FBRCG);   //发包人采购材料设备计价表
+       ImportExcel fbrcg = new ImportExcel(file,1,new String[]{BashInfo.SHEET_FBRCG,BashInfo.SHEET_FBRCG1});   //发包人采购材料设备计价表
         ImportExcel cbrcgsb = new ImportExcel(file,1,BashInfo.SHEET_FBRCG);   //发包人采购设备计价表
         //数据核验数据
         List<Settlement> settlementList =  SettementUtil.getComparison(total);
@@ -313,7 +313,7 @@ public class OverheadLineService {
         ImportExcel total = new ImportExcel(file,1,BashInfo.SHEET_HZB );  //工程项目竣工结算汇总表
         ImportExcel jzhz = new ImportExcel(file,1,BashInfo.SHEET_JZHZB );   //电缆线路建筑工程费用汇总表
         ImportExcel azhz = new ImportExcel(file,1,BashInfo.SHEET_HZHZB );   //电缆线路安装工程费用汇总表
-        ImportExcel fbrcg = new ImportExcel(file,1,BashInfo.SHEET_FBRCG);   //发包人采购材料设备计价表
+        ImportExcel fbrcg = new ImportExcel(file,1,new String[]{BashInfo.SHEET_FBRCG,BashInfo.SHEET_FBRCG1});   //发包人采购材料设备计价表
 //        ImportExcel cbrcgsb = new ImportExcel(file,1,BashInfo.SHEET_FBRCG);   //发包人采购设备计价表
         //数据核验数据
 //        Map<String,Object[]> builtMap = BashInfo.getCompletionWorks(total);//获取工程项目竣工所有数据

+ 1 - 0
src/main/java/com/jeeplus/modules/sg/overheadline/util/BashInfo.java

@@ -17,6 +17,7 @@ public class BashInfo {
     public static final String SHEET_GFQD = "规费项目清单计价表";
     public static final String SHEET_GCHZ = "架空线路工程费用汇总表";
     public static final String SHEET_FBRCG = "发包人采购材料设备计价表";
+    public static final String SHEET_FBRCG1 = "发包人采购材料(设备)计价表";
     public static final String SHEET_CBRCG = "承包人采购设备计价表";
     public static final String SHEET_JZFBFXJJ = "建筑分部分项工程量清单计价表";
     public static final String SHEET_AZFBFXJJ = "安装分部分项工程量清单计价表";