|
|
|
@ -12,10 +12,7 @@ import jnpf.purchaseorder.utils.VehiclePictureFolderUtils;
|
|
|
|
|
import jnpf.util.FilePathUtil;
|
|
|
|
|
import jnpf.util.JsonUtil;
|
|
|
|
|
import jnpf.util.context.SpringContext;
|
|
|
|
|
import org.apache.poi.ss.usermodel.Cell;
|
|
|
|
|
import org.apache.poi.ss.usermodel.CellType;
|
|
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
|
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
|
|
import org.apache.poi.ss.util.NumberToTextConverter;
|
|
|
|
|
import org.springframework.util.FileCopyUtils;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
@ -154,8 +151,8 @@ public class FileCopy {
|
|
|
|
|
// System.out.println(objects1);
|
|
|
|
|
List<Object> objects2 = reader.readColumn(0, 0, 1);
|
|
|
|
|
// 公司名字
|
|
|
|
|
String companyStr = String.valueOf(objects2.get(0));
|
|
|
|
|
companyStr=companyStr.substring(0,companyStr.lastIndexOf("公司")+2);
|
|
|
|
|
// String companyStr = String.valueOf(objects2.get(0));
|
|
|
|
|
// companyStr=companyStr.substring(0,companyStr.lastIndexOf("公司")+2);
|
|
|
|
|
// 销售合同编码
|
|
|
|
|
String infoStr = String.valueOf(objects2.get(1));
|
|
|
|
|
|
|
|
|
@ -182,7 +179,7 @@ public class FileCopy {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Cell cell = row.createCell(19);
|
|
|
|
|
Cell cell1 = row.createCell(20);
|
|
|
|
|
// Cell cell1 = row.createCell(20);
|
|
|
|
|
Cell cell2 = row.createCell(21);
|
|
|
|
|
Cell cell3 = row.createCell(22);
|
|
|
|
|
Cell cell4 = row.createCell(23);
|
|
|
|
@ -230,7 +227,7 @@ public class FileCopy {
|
|
|
|
|
cell.setCellValue(String.valueOf(o1).equals("null") ? "" : JsonUtil.getListToJsonArray((List<Map<String,Object>>)o1).toString());
|
|
|
|
|
|
|
|
|
|
cell4.setCellValue(String.valueOf(o2).equals("null") ? "" :JsonUtil.getListToJsonArray((List<Map<String,Object>>)o2).toString());
|
|
|
|
|
cell1.setCellValue(companyStr);
|
|
|
|
|
// cell1.setCellValue(companyStr);
|
|
|
|
|
cell2.setCellValue(str);
|
|
|
|
|
cell3.setCellValue(str3);
|
|
|
|
|
cell5.setCellType(CellType.STRING);
|
|
|
|
@ -243,8 +240,21 @@ public class FileCopy {
|
|
|
|
|
|
|
|
|
|
strCell1.setCellType(CellType.STRING);
|
|
|
|
|
strCell1.setCellValue(FileCopy.setSteColumn(strCell1));
|
|
|
|
|
strCell2.setCellType(CellType.STRING);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (strCell2.getCellType() == CellType.NUMERIC) {
|
|
|
|
|
//hssfCell.setCellType(1);//设置为String
|
|
|
|
|
//String str_temp = String.valueOf(hssfCell.getRichStringCellValue());//得到值
|
|
|
|
|
DataFormatter dataFormatter = new DataFormatter();
|
|
|
|
|
FormulaEvaluator fe = writer.getWorkbook()
|
|
|
|
|
.getCreationHelper()
|
|
|
|
|
.createFormulaEvaluator();
|
|
|
|
|
String str_temp = dataFormatter.formatCellValue(strCell2, fe);
|
|
|
|
|
strCell2.setCellValue(str_temp);
|
|
|
|
|
}else {
|
|
|
|
|
strCell2.setCellValue(FileCopy.setSteColumn(strCell2));
|
|
|
|
|
}
|
|
|
|
|
strCell2.setCellType(CellType.STRING);
|
|
|
|
|
strCell3.setCellType(CellType.STRING);
|
|
|
|
|
strCell3.setCellValue(FileCopy.setSteColumn(strCell3));
|
|
|
|
|
strCell4.setCellType(CellType.STRING);
|
|
|
|
|