|
|
|
@ -35,7 +35,16 @@ public class FileCopy {
|
|
|
|
|
// 磅单图片对应的信息
|
|
|
|
|
HashMap<String, Object> fileMap = new HashMap<>();
|
|
|
|
|
// 车辆图片对应的信息
|
|
|
|
|
HashMap<String, Object> carFileMap = new HashMap<>();
|
|
|
|
|
HashMap<String, Object> carFileMap2 = new HashMap<>();
|
|
|
|
|
HashMap<String, Object> carFileMap3 = new HashMap<>();
|
|
|
|
|
HashMap<String, Object> carFileMap4 = new HashMap<>();
|
|
|
|
|
HashMap<String, Object> carFileMap5 = new HashMap<>();
|
|
|
|
|
HashMap<String, Object> carFileMap6 = new HashMap<>();
|
|
|
|
|
HashMap<String, Object> carFileMap7 = new HashMap<>();
|
|
|
|
|
HashMap<String, Object> carFileMap8 = new HashMap<>();
|
|
|
|
|
HashMap<String, Object> carFileMap9 = new HashMap<>();
|
|
|
|
|
HashMap<String, Object> carFileMap10 = new HashMap<>();
|
|
|
|
|
HashMap<String, Object> carFileMap11 = new HashMap<>();
|
|
|
|
|
HashMap<String, VehiclePictureFolder> folderHashMap = new HashMap<>();
|
|
|
|
|
ArrayList<Object> resultList = new ArrayList<>();
|
|
|
|
|
File excelFile = null;
|
|
|
|
@ -63,13 +72,40 @@ public class FileCopy {
|
|
|
|
|
fileName = fileName+String.valueOf(resultListt.get(0));
|
|
|
|
|
}
|
|
|
|
|
if (resultListt.get(1) != null) {
|
|
|
|
|
carFileMap.putAll ((HashMap<String, Object>) resultListt.get(1));
|
|
|
|
|
carFileMap2.putAll ((HashMap<String, Object>) resultListt.get(1));
|
|
|
|
|
}
|
|
|
|
|
if (resultListt.get(2) != null) {
|
|
|
|
|
fileMap.putAll ((HashMap<String, Object>) resultListt.get(2));
|
|
|
|
|
carFileMap3.putAll ((HashMap<String, Object>) resultListt.get(2));
|
|
|
|
|
}
|
|
|
|
|
if (resultListt.get(3)!=null){
|
|
|
|
|
folderHashMap.putAll((HashMap<String,VehiclePictureFolder>) resultListt.get(3));
|
|
|
|
|
if (resultListt.get(3) != null) {
|
|
|
|
|
carFileMap4.putAll ((HashMap<String, Object>) resultListt.get(3));
|
|
|
|
|
}
|
|
|
|
|
if (resultListt.get(4) != null) {
|
|
|
|
|
carFileMap5.putAll ((HashMap<String, Object>) resultListt.get(4));
|
|
|
|
|
}
|
|
|
|
|
if (resultListt.get(5) != null) {
|
|
|
|
|
carFileMap6.putAll ((HashMap<String, Object>) resultListt.get(5));
|
|
|
|
|
}
|
|
|
|
|
if (resultListt.get(6) != null) {
|
|
|
|
|
carFileMap7.putAll ((HashMap<String, Object>) resultListt.get(6));
|
|
|
|
|
}
|
|
|
|
|
if (resultListt.get(7) != null) {
|
|
|
|
|
carFileMap8.putAll ((HashMap<String, Object>) resultListt.get(7));
|
|
|
|
|
}
|
|
|
|
|
if (resultListt.get(8) != null) {
|
|
|
|
|
carFileMap9.putAll ((HashMap<String, Object>) resultListt.get(8));
|
|
|
|
|
}
|
|
|
|
|
if (resultListt.get(9) != null) {
|
|
|
|
|
carFileMap10.putAll ((HashMap<String, Object>) resultListt.get(9));
|
|
|
|
|
}
|
|
|
|
|
if (resultListt.get(10) != null) {
|
|
|
|
|
carFileMap11.putAll ((HashMap<String, Object>) resultListt.get(10));
|
|
|
|
|
}
|
|
|
|
|
if (resultListt.get(11) != null) {
|
|
|
|
|
fileMap.putAll ((HashMap<String, Object>) resultListt.get(11));
|
|
|
|
|
}
|
|
|
|
|
if (resultListt.get(12)!=null){
|
|
|
|
|
folderHashMap.putAll((HashMap<String,VehiclePictureFolder>) resultListt.get(12));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (file.isFile()) {
|
|
|
|
@ -123,13 +159,85 @@ public class FileCopy {
|
|
|
|
|
} else {
|
|
|
|
|
fileMap.put(parentName, list);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (carFileMap.containsKey(parentName)) {
|
|
|
|
|
List<Object> o = (List<Object>) carFileMap.get(parentName);
|
|
|
|
|
} else if(indexString.equals("2")||indexString.equals(parentName)) {
|
|
|
|
|
if (carFileMap2.containsKey(parentName)) {
|
|
|
|
|
List<Object> o = (List<Object>) carFileMap2.get(parentName);
|
|
|
|
|
o.add(dataMap);
|
|
|
|
|
carFileMap2.put(parentName, o);
|
|
|
|
|
} else {
|
|
|
|
|
carFileMap2.put(parentName, list);
|
|
|
|
|
}
|
|
|
|
|
} else if(indexString.equals("3")||indexString.equals(parentName)) {
|
|
|
|
|
if (carFileMap3.containsKey(parentName)) {
|
|
|
|
|
List<Object> o = (List<Object>) carFileMap3.get(parentName);
|
|
|
|
|
o.add(dataMap);
|
|
|
|
|
carFileMap3.put(parentName, o);
|
|
|
|
|
} else {
|
|
|
|
|
carFileMap3.put(parentName, list);
|
|
|
|
|
}
|
|
|
|
|
} else if(indexString.equals("4")||indexString.equals(parentName)) {
|
|
|
|
|
if (carFileMap4.containsKey(parentName)) {
|
|
|
|
|
List<Object> o = (List<Object>) carFileMap4.get(parentName);
|
|
|
|
|
o.add(dataMap);
|
|
|
|
|
carFileMap.put(parentName, o);
|
|
|
|
|
carFileMap4.put(parentName, o);
|
|
|
|
|
} else {
|
|
|
|
|
carFileMap.put(parentName, list);
|
|
|
|
|
carFileMap4.put(parentName, list);
|
|
|
|
|
}
|
|
|
|
|
} else if(indexString.equals("5")||indexString.equals(parentName)) {
|
|
|
|
|
if (carFileMap5.containsKey(parentName)) {
|
|
|
|
|
List<Object> o = (List<Object>) carFileMap5.get(parentName);
|
|
|
|
|
o.add(dataMap);
|
|
|
|
|
carFileMap5.put(parentName, o);
|
|
|
|
|
} else {
|
|
|
|
|
carFileMap5.put(parentName, list);
|
|
|
|
|
}
|
|
|
|
|
} else if(indexString.equals("6")||indexString.equals(parentName)) {
|
|
|
|
|
if (carFileMap6.containsKey(parentName)) {
|
|
|
|
|
List<Object> o = (List<Object>) carFileMap6.get(parentName);
|
|
|
|
|
o.add(dataMap);
|
|
|
|
|
carFileMap6.put(parentName, o);
|
|
|
|
|
} else {
|
|
|
|
|
carFileMap6.put(parentName, list);
|
|
|
|
|
}
|
|
|
|
|
} else if(indexString.equals("7")||indexString.equals(parentName)) {
|
|
|
|
|
if (carFileMap7.containsKey(parentName)) {
|
|
|
|
|
List<Object> o = (List<Object>) carFileMap7.get(parentName);
|
|
|
|
|
o.add(dataMap);
|
|
|
|
|
carFileMap7.put(parentName, o);
|
|
|
|
|
} else {
|
|
|
|
|
carFileMap7.put(parentName, list);
|
|
|
|
|
}
|
|
|
|
|
} else if(indexString.equals("8")||indexString.equals(parentName)) {
|
|
|
|
|
if (carFileMap8.containsKey(parentName)) {
|
|
|
|
|
List<Object> o = (List<Object>) carFileMap8.get(parentName);
|
|
|
|
|
o.add(dataMap);
|
|
|
|
|
carFileMap8.put(parentName, o);
|
|
|
|
|
} else {
|
|
|
|
|
carFileMap8.put(parentName, list);
|
|
|
|
|
}
|
|
|
|
|
} else if(indexString.equals("9")||indexString.equals(parentName)) {
|
|
|
|
|
if (carFileMap9.containsKey(parentName)) {
|
|
|
|
|
List<Object> o = (List<Object>) carFileMap9.get(parentName);
|
|
|
|
|
o.add(dataMap);
|
|
|
|
|
carFileMap9.put(parentName, o);
|
|
|
|
|
} else {
|
|
|
|
|
carFileMap9.put(parentName, list);
|
|
|
|
|
}
|
|
|
|
|
} else if(indexString.equals("10")||indexString.equals(parentName)) {
|
|
|
|
|
if (carFileMap10.containsKey(parentName)) {
|
|
|
|
|
List<Object> o = (List<Object>) carFileMap10.get(parentName);
|
|
|
|
|
o.add(dataMap);
|
|
|
|
|
carFileMap10.put(parentName, o);
|
|
|
|
|
} else {
|
|
|
|
|
carFileMap10.put(parentName, list);
|
|
|
|
|
}
|
|
|
|
|
} else if(indexString.equals("11")||indexString.equals(parentName)) {
|
|
|
|
|
if (carFileMap11.containsKey(parentName)) {
|
|
|
|
|
List<Object> o = (List<Object>) carFileMap11.get(parentName);
|
|
|
|
|
o.add(dataMap);
|
|
|
|
|
carFileMap11.put(parentName, o);
|
|
|
|
|
} else {
|
|
|
|
|
carFileMap11.put(parentName, list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 将车辆照片存在车辆照片中
|
|
|
|
@ -181,10 +289,19 @@ public class FileCopy {
|
|
|
|
|
Cell cell333 = row.createCell(21);
|
|
|
|
|
Cell cell444 = row.createCell(22);
|
|
|
|
|
Cell cell555 = row.createCell(23);
|
|
|
|
|
Cell cell666 = row.createCell(24);
|
|
|
|
|
Cell cell777 = row.createCell(25);
|
|
|
|
|
Cell cell888 = row.createCell(26);
|
|
|
|
|
Cell cell999 = row.createCell(27);
|
|
|
|
|
Cell cellaaa = row.createCell(28);
|
|
|
|
|
Cell cellbbb = row.createCell(29);
|
|
|
|
|
Cell cellccc = row.createCell(30);
|
|
|
|
|
Cell cellddd = row.createCell(31);
|
|
|
|
|
Cell celleee = row.createCell(32);
|
|
|
|
|
/*Cell cell6 = row.createCell(25);
|
|
|
|
|
Cell cell7 = row.createCell(26);
|
|
|
|
|
Cell cell8 = row.createCell(27);*/
|
|
|
|
|
Cell strCell7 = row.getCell(1);//日期时间
|
|
|
|
|
// Cell strCell7 = row.getCell(1);//日期时间
|
|
|
|
|
/*Cell cell5 = row.getCell(9);
|
|
|
|
|
Cell strCell1 = row.getCell(8);
|
|
|
|
|
Cell strCell2 = row.getCell(7);
|
|
|
|
@ -205,32 +322,68 @@ public class FileCopy {
|
|
|
|
|
Cell cell33 = row1.createCell(21);
|
|
|
|
|
cell33.setCellValue("凭证图片");
|
|
|
|
|
Cell cell44 = row1.createCell(22);
|
|
|
|
|
cell44.setCellValue("车辆信息");
|
|
|
|
|
Cell cell55 = row1.createCell(22);
|
|
|
|
|
cell44.setCellValue("合同编码");
|
|
|
|
|
cell44.setCellValue("车辆信息1");
|
|
|
|
|
Cell cell55 = row1.createCell(23);
|
|
|
|
|
cell55.setCellValue("车辆信息2");
|
|
|
|
|
Cell cell66 = row1.createCell(24);
|
|
|
|
|
cell66.setCellValue("车辆信息3");
|
|
|
|
|
Cell cell77 = row1.createCell(25);
|
|
|
|
|
cell77.setCellValue("车辆信息4");
|
|
|
|
|
Cell cell88 = row1.createCell(26);
|
|
|
|
|
cell88.setCellValue("车辆信息5");
|
|
|
|
|
Cell cell99 = row1.createCell(27);
|
|
|
|
|
cell99.setCellValue("车辆信息6");
|
|
|
|
|
Cell cellaa = row1.createCell(28);
|
|
|
|
|
cellaa.setCellValue("车辆信息7");
|
|
|
|
|
Cell cellbb = row1.createCell(29);
|
|
|
|
|
cellbb.setCellValue("车辆信息8");
|
|
|
|
|
Cell cellcc = row1.createCell(30);
|
|
|
|
|
cellcc.setCellValue("车辆信息9");
|
|
|
|
|
Cell celldd = row1.createCell(31);
|
|
|
|
|
celldd.setCellValue("车辆信息10");
|
|
|
|
|
Cell cellee = row1.createCell(32);
|
|
|
|
|
cellee.setCellValue("合同编码");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Object o1 = fileMap.get(String.valueOf(o));
|
|
|
|
|
Object o2 = carFileMap.get(String.valueOf(o));
|
|
|
|
|
Object o2 = carFileMap2.get(String.valueOf(o));
|
|
|
|
|
Object o3 = carFileMap3.get(String.valueOf(o));
|
|
|
|
|
Object o4 = carFileMap4.get(String.valueOf(o));
|
|
|
|
|
Object o5 = carFileMap5.get(String.valueOf(o));
|
|
|
|
|
Object o6 = carFileMap6.get(String.valueOf(o));
|
|
|
|
|
Object o7 = carFileMap7.get(String.valueOf(o));
|
|
|
|
|
Object o8 = carFileMap8.get(String.valueOf(o));
|
|
|
|
|
Object o9 = carFileMap9.get(String.valueOf(o));
|
|
|
|
|
Object o10 = carFileMap10.get(String.valueOf(o));
|
|
|
|
|
Object o11 = carFileMap11.get(String.valueOf(o));
|
|
|
|
|
VehiclePictureFolder vehiclePictureFolder1 = folderHashMap.get(String.valueOf(o));
|
|
|
|
|
|
|
|
|
|
cell111.setCellValue(httpServletRequest.getParameter("businessType"));
|
|
|
|
|
cell222.setCellValue(httpServletRequest.getParameter("documentType"));
|
|
|
|
|
cell333.setCellValue(String.valueOf(o1).equals("null") ? "" : JsonUtil.getListToJsonArray((List<Map<String,Object>>)o1).toString());
|
|
|
|
|
cell444.setCellValue(String.valueOf(o2).equals("null") ? "" :JsonUtil.getListToJsonArray((List<Map<String,Object>>)o2).toString());
|
|
|
|
|
cell555.setCellValue(StringUtil.equals(httpServletRequest.getParameter("businessType"), "采购") ? str3 : str);
|
|
|
|
|
cell555.setCellValue(String.valueOf(o3).equals("null") ? "" :JsonUtil.getListToJsonArray((List<Map<String,Object>>)o3).toString());
|
|
|
|
|
cell666.setCellValue(String.valueOf(o4).equals("null") ? "" :JsonUtil.getListToJsonArray((List<Map<String,Object>>)o4).toString());
|
|
|
|
|
cell777.setCellValue(String.valueOf(o5).equals("null") ? "" :JsonUtil.getListToJsonArray((List<Map<String,Object>>)o5).toString());
|
|
|
|
|
cell888.setCellValue(String.valueOf(o6).equals("null") ? "" :JsonUtil.getListToJsonArray((List<Map<String,Object>>)o6).toString());
|
|
|
|
|
cell999.setCellValue(String.valueOf(o7).equals("null") ? "" :JsonUtil.getListToJsonArray((List<Map<String,Object>>)o7).toString());
|
|
|
|
|
cellaaa.setCellValue(String.valueOf(o8).equals("null") ? "" :JsonUtil.getListToJsonArray((List<Map<String,Object>>)o8).toString());
|
|
|
|
|
cellbbb.setCellValue(String.valueOf(o9).equals("null") ? "" :JsonUtil.getListToJsonArray((List<Map<String,Object>>)o9).toString());
|
|
|
|
|
cellccc.setCellValue(String.valueOf(o10).equals("null") ? "" :JsonUtil.getListToJsonArray((List<Map<String,Object>>)o10).toString());
|
|
|
|
|
cellddd.setCellValue(String.valueOf(o11).equals("null") ? "" :JsonUtil.getListToJsonArray((List<Map<String,Object>>)o11).toString());
|
|
|
|
|
celleee.setCellValue(StringUtil.equals(httpServletRequest.getParameter("businessType"), "采购") ? str3 : str);
|
|
|
|
|
/*if (vehiclePictureFolder1!=null){
|
|
|
|
|
cell6.setCellValue(vehiclePictureFolder1.getDriverName()!=null?vehiclePictureFolder1.getDriverName():"");
|
|
|
|
|
cell7.setCellValue(vehiclePictureFolder1.getPhoneNumber()!=null?vehiclePictureFolder1.getPhoneNumber():"");
|
|
|
|
|
cell8.setCellValue(vehiclePictureFolder1.getCarNumber()!=null?vehiclePictureFolder1.getCarNumber():"");
|
|
|
|
|
}*/
|
|
|
|
|
String stringCellValue = VehiclePictureFolderUtils.getValue(strCell7);
|
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//定义新的日期格式
|
|
|
|
|
SimpleDateFormat formatter1 = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式
|
|
|
|
|
SimpleDateFormat formatter2 = new SimpleDateFormat("yyyy/MM/dd K:mm:ss a");//定义新的日期格式
|
|
|
|
|
SimpleDateFormat formatter3 = new SimpleDateFormat("yyyy.MM.dd");//定义新的日期格式
|
|
|
|
|
// String stringCellValue = VehiclePictureFolderUtils.getValue(strCell7);
|
|
|
|
|
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//定义新的日期格式
|
|
|
|
|
// SimpleDateFormat formatter1 = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式
|
|
|
|
|
// SimpleDateFormat formatter2 = new SimpleDateFormat("yyyy/MM/dd K:mm:ss a");//定义新的日期格式
|
|
|
|
|
// SimpleDateFormat formatter3 = new SimpleDateFormat("yyyy.MM.dd");//定义新的日期格式
|
|
|
|
|
//format():将给定的 Date 格式化为日期/时间字符串。即:date--->String
|
|
|
|
|
try {
|
|
|
|
|
/*try {
|
|
|
|
|
if (stringCellValue.contains("/")){
|
|
|
|
|
Date date = formatter2.parse(stringCellValue);//parse():String--->date
|
|
|
|
|
strCell7.setCellValue(formatter.format(date));
|
|
|
|
@ -247,7 +400,7 @@ public class FileCopy {
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
writer.flush(excelFile);
|
|
|
|
|
writer.close();
|
|
|
|
@ -264,8 +417,16 @@ public class FileCopy {
|
|
|
|
|
System.out.println(fileLoader);
|
|
|
|
|
System.out.println(fileLoader.getName());
|
|
|
|
|
resultList.add(fileLoader.getName());
|
|
|
|
|
resultList.add(carFileMap);
|
|
|
|
|
|
|
|
|
|
resultList.add(carFileMap2);
|
|
|
|
|
resultList.add(carFileMap3);
|
|
|
|
|
resultList.add(carFileMap4);
|
|
|
|
|
resultList.add(carFileMap5);
|
|
|
|
|
resultList.add(carFileMap6);
|
|
|
|
|
resultList.add(carFileMap7);
|
|
|
|
|
resultList.add(carFileMap8);
|
|
|
|
|
resultList.add(carFileMap9);
|
|
|
|
|
resultList.add(carFileMap10);
|
|
|
|
|
resultList.add(carFileMap11);
|
|
|
|
|
resultList.add(fileMap);
|
|
|
|
|
resultList.add(folderHashMap);
|
|
|
|
|
return resultList;
|
|
|
|
@ -279,7 +440,16 @@ public class FileCopy {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
resultList.add(fileName);
|
|
|
|
|
resultList.add(carFileMap);
|
|
|
|
|
resultList.add(carFileMap2);
|
|
|
|
|
resultList.add(carFileMap3);
|
|
|
|
|
resultList.add(carFileMap4);
|
|
|
|
|
resultList.add(carFileMap5);
|
|
|
|
|
resultList.add(carFileMap6);
|
|
|
|
|
resultList.add(carFileMap7);
|
|
|
|
|
resultList.add(carFileMap8);
|
|
|
|
|
resultList.add(carFileMap9);
|
|
|
|
|
resultList.add(carFileMap10);
|
|
|
|
|
resultList.add(carFileMap11);
|
|
|
|
|
resultList.add(fileMap);
|
|
|
|
|
resultList.add(folderHashMap);
|
|
|
|
|
return resultList;
|
|
|
|
|