diff --git a/jnpf-java-boot/jnpf-scm/jnpf-scm-biz/src/main/java/jnpf/service/impl/VoucherServiceImpl.java b/jnpf-java-boot/jnpf-scm/jnpf-scm-biz/src/main/java/jnpf/service/impl/VoucherServiceImpl.java index 0fb78df9..fd4bcf68 100644 --- a/jnpf-java-boot/jnpf-scm/jnpf-scm-biz/src/main/java/jnpf/service/impl/VoucherServiceImpl.java +++ b/jnpf-java-boot/jnpf-scm/jnpf-scm-biz/src/main/java/jnpf/service/impl/VoucherServiceImpl.java @@ -72,6 +72,9 @@ public class VoucherServiceImpl extends ServiceImpl getList(VoucherPagination voucherPagination){ return getTypeList(voucherPagination,voucherPagination.getDataType()); @@ -813,7 +816,6 @@ public class VoucherServiceImpl extends ServiceImpl contractLQueryWrapper=new QueryWrapper<>(); + contractLQueryWrapper.lambda().eq(ContractLEntity::getContractNumber, voucherEntity.getContractNo()); + List contractLEntityList = contractLService.list(contractLQueryWrapper); + if(contractLEntityList != null && contractLEntityList.size() > 0){ + voucherEntity.setModeTransport(contractLEntityList.get(0).getModeTransport());//运输方式 + voucherEntity.setCustomerId(contractLEntityList.get(0).getDeptId()); + voucherEntity.setCustomerName(""); + voucherEntity.setSupplierId(contractLEntityList.get(0).getSubject()); + voucherEntity.setSupplierName(""); + }else{ + num ++; + failResult.add(BeanUtil.beanToMap(model)); + continue; + } //车辆id if(StringUtil.isEmpty(voucherEntity.getVehicleName())){ voucherEntity.setVehicleId(""); @@ -908,22 +923,18 @@ public class VoucherServiceImpl extends ServiceImpl fileMap = new HashMap<>(); // 车辆图片对应的信息 - HashMap carFileMap = new HashMap<>(); + HashMap carFileMap2 = new HashMap<>(); + HashMap carFileMap3 = new HashMap<>(); + HashMap carFileMap4 = new HashMap<>(); + HashMap carFileMap5 = new HashMap<>(); + HashMap carFileMap6 = new HashMap<>(); + HashMap carFileMap7 = new HashMap<>(); + HashMap carFileMap8 = new HashMap<>(); + HashMap carFileMap9 = new HashMap<>(); + HashMap carFileMap10 = new HashMap<>(); + HashMap carFileMap11 = new HashMap<>(); HashMap folderHashMap = new HashMap<>(); ArrayList 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) resultListt.get(1)); + carFileMap2.putAll ((HashMap) resultListt.get(1)); } if (resultListt.get(2) != null) { - fileMap.putAll ((HashMap) resultListt.get(2)); + carFileMap3.putAll ((HashMap) resultListt.get(2)); } - if (resultListt.get(3)!=null){ - folderHashMap.putAll((HashMap) resultListt.get(3)); + if (resultListt.get(3) != null) { + carFileMap4.putAll ((HashMap) resultListt.get(3)); + } + if (resultListt.get(4) != null) { + carFileMap5.putAll ((HashMap) resultListt.get(4)); + } + if (resultListt.get(5) != null) { + carFileMap6.putAll ((HashMap) resultListt.get(5)); + } + if (resultListt.get(6) != null) { + carFileMap7.putAll ((HashMap) resultListt.get(6)); + } + if (resultListt.get(7) != null) { + carFileMap8.putAll ((HashMap) resultListt.get(7)); + } + if (resultListt.get(8) != null) { + carFileMap9.putAll ((HashMap) resultListt.get(8)); + } + if (resultListt.get(9) != null) { + carFileMap10.putAll ((HashMap) resultListt.get(9)); + } + if (resultListt.get(10) != null) { + carFileMap11.putAll ((HashMap) resultListt.get(10)); + } + if (resultListt.get(11) != null) { + fileMap.putAll ((HashMap) resultListt.get(11)); + } + if (resultListt.get(12)!=null){ + folderHashMap.putAll((HashMap) resultListt.get(12)); } } if (file.isFile()) { @@ -123,13 +159,85 @@ public class FileCopy { } else { fileMap.put(parentName, list); } - } else { - if (carFileMap.containsKey(parentName)) { - List o = (List) carFileMap.get(parentName); + } else if(indexString.equals("2")||indexString.equals(parentName)) { + if (carFileMap2.containsKey(parentName)) { + List o = (List) 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 o = (List) 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 o = (List) 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 o = (List) 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 o = (List) 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 o = (List) 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 o = (List) 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 o = (List) 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 o = (List) 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 o = (List) 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>)o1).toString()); cell444.setCellValue(String.valueOf(o2).equals("null") ? "" :JsonUtil.getListToJsonArray((List>)o2).toString()); - cell555.setCellValue(StringUtil.equals(httpServletRequest.getParameter("businessType"), "采购") ? str3 : str); + cell555.setCellValue(String.valueOf(o3).equals("null") ? "" :JsonUtil.getListToJsonArray((List>)o3).toString()); + cell666.setCellValue(String.valueOf(o4).equals("null") ? "" :JsonUtil.getListToJsonArray((List>)o4).toString()); + cell777.setCellValue(String.valueOf(o5).equals("null") ? "" :JsonUtil.getListToJsonArray((List>)o5).toString()); + cell888.setCellValue(String.valueOf(o6).equals("null") ? "" :JsonUtil.getListToJsonArray((List>)o6).toString()); + cell999.setCellValue(String.valueOf(o7).equals("null") ? "" :JsonUtil.getListToJsonArray((List>)o7).toString()); + cellaaa.setCellValue(String.valueOf(o8).equals("null") ? "" :JsonUtil.getListToJsonArray((List>)o8).toString()); + cellbbb.setCellValue(String.valueOf(o9).equals("null") ? "" :JsonUtil.getListToJsonArray((List>)o9).toString()); + cellccc.setCellValue(String.valueOf(o10).equals("null") ? "" :JsonUtil.getListToJsonArray((List>)o10).toString()); + cellddd.setCellValue(String.valueOf(o11).equals("null") ? "" :JsonUtil.getListToJsonArray((List>)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; diff --git a/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/VoucherController.java b/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/VoucherController.java index 78622b53..61b994a1 100644 --- a/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/VoucherController.java +++ b/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/VoucherController.java @@ -1481,7 +1481,7 @@ public class VoucherController { @Operation(summary = "导入预览" ) @GetMapping("/ImportPreview") public ActionResult> ImportPreview(String fileName) throws Exception { - fileName = "6642d1dc64a4fc5279e1560b.xls"; + fileName = "66441f9464a4bd991e589f74.xls"; Map headAndDataMap = new HashMap<>(2); String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getWebAnnexFilePath(); FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName); @@ -1517,7 +1517,16 @@ public class VoucherController { columns.add(new ExcelImFieldModel("telephone","联系方式")); columns.add(new ExcelImFieldModel("remark1","备注")); columns.add(new ExcelImFieldModel("voucherPictures","凭证图片")); - columns.add(new ExcelImFieldModel("vehiclePictures","车辆信息")); + columns.add(new ExcelImFieldModel("vehiclePictures1","车辆信息1")); + columns.add(new ExcelImFieldModel("vehiclePictures2","车辆信息2")); + columns.add(new ExcelImFieldModel("vehiclePictures3","车辆信息3")); + columns.add(new ExcelImFieldModel("vehiclePictures4","车辆信息4")); + columns.add(new ExcelImFieldModel("vehiclePictures5","车辆信息5")); + columns.add(new ExcelImFieldModel("vehiclePictures6","车辆信息6")); + columns.add(new ExcelImFieldModel("vehiclePictures7","车辆信息7")); + columns.add(new ExcelImFieldModel("vehiclePictures8","车辆信息8")); + columns.add(new ExcelImFieldModel("vehiclePictures9","车辆信息9")); + columns.add(new ExcelImFieldModel("vehiclePictures10","车辆信息10")); columns.add(new ExcelImFieldModel("contractNo","合同编码")); //tableField111子表对象 List tableField111columns = new ArrayList<>(); diff --git a/jnpf-java-boot/jnpf-scm/jnpf-scm-entity/src/main/java/jnpf/model/voucher/VoucherExcelVO222.java b/jnpf-java-boot/jnpf-scm/jnpf-scm-entity/src/main/java/jnpf/model/voucher/VoucherExcelVO222.java index fe866b5a..52850632 100644 --- a/jnpf-java-boot/jnpf-scm/jnpf-scm-entity/src/main/java/jnpf/model/voucher/VoucherExcelVO222.java +++ b/jnpf-java-boot/jnpf-scm/jnpf-scm-entity/src/main/java/jnpf/model/voucher/VoucherExcelVO222.java @@ -63,8 +63,26 @@ public class VoucherExcelVO222 { private String remark1; @Excel(name = "凭证图片" ) private String voucherPictures; - @Excel(name = "车辆信息" ) - private String vehiclePictures; + @Excel(name = "车辆信息1" ) + private String vehiclePictures1; + @Excel(name = "车辆信息2" ) + private String vehiclePictures2; + @Excel(name = "车辆信息3" ) + private String vehiclePictures3; + @Excel(name = "车辆信息4" ) + private String vehiclePictures4; + @Excel(name = "车辆信息5" ) + private String vehiclePictures5; + @Excel(name = "车辆信息6" ) + private String vehiclePictures6; + @Excel(name = "车辆信息7" ) + private String vehiclePictures7; + @Excel(name = "车辆信息8" ) + private String vehiclePictures8; + @Excel(name = "车辆信息9" ) + private String vehiclePictures9; + @Excel(name = "车辆信息10" ) + private String vehiclePictures10; @Excel(name = "合同编码" ) private String contractNo; private List list; diff --git a/jnpf-java-boot/jnpf-web/src/components/JNPFImport/index.vue b/jnpf-java-boot/jnpf-web/src/components/JNPFImport/index.vue index 4102cf65..ddb5150b 100644 --- a/jnpf-java-boot/jnpf-web/src/components/JNPFImport/index.vue +++ b/jnpf-java-boot/jnpf-web/src/components/JNPFImport/index.vue @@ -38,8 +38,22 @@ +