|  | @@ -348,19 +348,18 @@ public class GoodsController {
 | 
											
												
													
														|  |              String newFilePath = filePath + fileName;
 |  |              String newFilePath = filePath + fileName;
 | 
											
												
													
														|  |              File zipFile = new File(newFilePath);
 |  |              File zipFile = new File(newFilePath);
 | 
											
												
													
														|  |              unZipFiles(zipFile, path,list,type);//解压文件,获取文件路径
 |  |              unZipFiles(zipFile, path,list,type);//解压文件,获取文件路径
 | 
											
												
													
														|  | -        } catch (IOException e) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +        } catch (Exception e) {
 | 
											
												
													
														|  |              e.printStackTrace();
 |  |              e.printStackTrace();
 | 
											
												
													
														|  | -            System.out.println("解压执行失败");
 |  | 
 | 
											
												
													
														|  | 
 |  | +            logger.info("解压执行失败");
 | 
											
												
													
														|  |              throw e;
 |  |              throw e;
 | 
											
												
													
														|  | 
 |  | +        }finally {
 | 
											
												
													
														|  | 
 |  | +            //程序结束时,删除临时文件
 | 
											
												
													
														|  | 
 |  | +            deleteFiles(filePath);//删除压缩包文件夹
 | 
											
												
													
														|  | 
 |  | +            deleteFiles(path);//删除解压文件夹**
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |          logger.info(JSON.toJSONString(list));
 |  |          logger.info(JSON.toJSONString(list));
 | 
											
												
													
														|  | -        //程序结束时,删除临时文件
 |  | 
 | 
											
												
													
														|  | -        deleteFiles(filePath);//删除压缩包文件夹
 |  | 
 | 
											
												
													
														|  | -        deleteFiles(path);//删除解压文件夹**
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -        Map<String, Object> jsonMap = new HashMap<String, Object>();
 |  | 
 | 
											
												
													
														|  | 
 |  | +        Map<String, Object> jsonMap = new HashMap<>();
 | 
											
												
													
														|  |          jsonMap.put("ret",list);
 |  |          jsonMap.put("ret",list);
 | 
											
												
													
														|  |          return jsonMap;
 |  |          return jsonMap;
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
										
											
												
													
														|  | @@ -393,17 +392,14 @@ public class GoodsController {
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      public void unZipFiles(File srcFile, String destDirPath, List<String> list, int type) throws RuntimeException {
 |  |      public void unZipFiles(File srcFile, String destDirPath, List<String> list, int type) throws RuntimeException {
 | 
											
												
													
														|  |          long start = System.currentTimeMillis();
 |  |          long start = System.currentTimeMillis();
 | 
											
												
													
														|  | 
 |  | +        ZipFile zipFile = null;
 | 
											
												
													
														|  | 
 |  | +        try {
 | 
											
												
													
														|  |          // 判断源文件是否存在
 |  |          // 判断源文件是否存在
 | 
											
												
													
														|  |          if (!srcFile.exists()) {
 |  |          if (!srcFile.exists()) {
 | 
											
												
													
														|  |              throw new RuntimeException(srcFile.getPath() + "所指文件不存在");
 |  |              throw new RuntimeException(srcFile.getPath() + "所指文件不存在");
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          // 开始解压
 |  |          // 开始解压
 | 
											
												
													
														|  | -        ZipFile zipFile = null;
 |  | 
 | 
											
												
													
														|  | -        try {
 |  | 
 | 
											
												
													
														|  | -            zipFile = new ZipFile(srcFile);
 |  | 
 | 
											
												
													
														|  | -        } catch (IOException e) {
 |  | 
 | 
											
												
													
														|  | -            throw new RRException("zip文件解压出错", e);
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | 
 |  | +        zipFile = new ZipFile(srcFile);
 | 
											
												
													
														|  |          zipFile.getEncoding();
 |  |          zipFile.getEncoding();
 | 
											
												
													
														|  |          Enumeration<?> entries = zipFile.getEntries();
 |  |          Enumeration<?> entries = zipFile.getEntries();
 | 
											
												
													
														|  |          List<ZipEntry> entryList = new ArrayList<>();
 |  |          List<ZipEntry> entryList = new ArrayList<>();
 | 
											
										
											
												
													
														|  | @@ -413,13 +409,12 @@ public class GoodsController {
 | 
											
												
													
														|  |              entryList.add(entry);
 |  |              entryList.add(entry);
 | 
											
												
													
														|  |              // 如果是文件夹,就创建个文件夹
 |  |              // 如果是文件夹,就创建个文件夹
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  | -        if(null==entryList){
 |  | 
 | 
											
												
													
														|  | -            throw new RRException("文件夹内无图片信息,请检查后重试");
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        if(entryList.size()>30){
 |  | 
 | 
											
												
													
														|  | -            throw new RRException("最多上传30张图片");
 |  | 
 | 
											
												
													
														|  | -        }
 |  | 
 | 
											
												
													
														|  | -        try {
 |  | 
 | 
											
												
													
														|  | 
 |  | +                if(null==entryList){
 | 
											
												
													
														|  | 
 |  | +                    throw new RRException("文件夹内无图片信息,请检查后重试");
 | 
											
												
													
														|  | 
 |  | +                }
 | 
											
												
													
														|  | 
 |  | +                if(entryList.size()>30){
 | 
											
												
													
														|  | 
 |  | +                    throw new RRException("最多上传30张图片");
 | 
											
												
													
														|  | 
 |  | +                }
 | 
											
												
													
														|  |              for(ZipEntry entry : entryList){
 |  |              for(ZipEntry entry : entryList){
 | 
											
												
													
														|  |                  if (entry.isDirectory()) {
 |  |                  if (entry.isDirectory()) {
 | 
											
												
													
														|  |                      String dirPath = destDirPath + "/" + entry.getName();
 |  |                      String dirPath = destDirPath + "/" + entry.getName();
 |