# 云E办 **Repository Path**: lightning-whip/cloud-e-office ## Basic Information - **Project Name**: 云E办 - **Description**: 项目01 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: develop - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 0 - **Created**: 2020-12-18 - **Last Updated**: 2021-08-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 工作模式介绍 环境: jdk 8 idea 2019 mysql 8.0.+ ​ username: root ​ password: 123456 日志:记录每天的工作,与及任务进程 资料文档:所有操作的参考文档 项目文档:待定 test:用来测试,学习 文件存储使用minio:开源,简便,并且1有中文社区 打开虚拟机输入命令; ``` docker run -p 9000:9000 \ -e "MINIO_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE" \ -e "MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" \ minio/minio server /data ``` 登录:http://192.168.10.100:9000/ access:AKIAIOSFODNN7EXAMPLE secret:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY 添加桶,设置为读和写 ![输入图片说明](https://images.gitee.com/uploads/images/2020/1223/111650_4e3d70fb_8114588.png "屏幕截图.png") 下次启动minio: docker start 容器id redis启动: cd /usr/local/redis/bin ./redis-server redis.conf 启动消息队列: service rabbit-server.server start`这里输入代码` 改进版本:打包成 7z的那个,修改EmployeeServiceImpl.java代码 ``` @Transactional(readOnly = false,rollbackFor = Exception.class) @Override public boolean batchImport(String fileName, MultipartFile file) throws Exception { boolean notNull = false; List userList = new ArrayList<>(); if (!fileName.matches("^.+\\.(?i)(xls)$") && !fileName.matches("^.+\\.(?i)(xlsx)$")) { throw new ParamsException("上传文件格式不正确"); } boolean isExcel2003 = true; if (fileName.matches("^.+\\.(?i)(xlsx)$")) { isExcel2003 = false; } InputStream is = file.getInputStream(); Workbook wb = null; if (isExcel2003) { wb = new HSSFWorkbook(is); } else { wb = new XSSFWorkbook(is); } Sheet sheet = wb.getSheetAt(0); if(sheet!=null){ notNull = true; } Employee user; for (int r = 4; r <= sheet.getLastRowNum(); r++) { Row row = sheet.getRow(r); if (row == null||row.getCell(1)==null){ continue; } user = new Employee(); //String name = row.getCell(0).getStringCellValue(); if(user.getId()!=null) user.setId( Integer.valueOf(row.getCell(0).getStringCellValue())); user.setName(row.getCell(1).getStringCellValue()); String value = row.getCell(2).getStringCellValue(); String[] dates=value.trim().split("-"); System.out.println("-----------------------"+value); LocalDate of = LocalDate.of(Integer.valueOf(dates[0]),Integer.valueOf(dates[1]),Integer.valueOf(dates[2])); user.setBirthday(of); user.setIdCard(row.getCell(3).getStringCellValue()); user.setWedlock(row.getCell(4).getStringCellValue()); user.setNationId(Integer.valueOf(row.getCell(5).getStringCellValue())); user.setNativePlace(row.getCell(6).getStringCellValue()); System.out.println(user); userList.add(user); } for (Employee userResord : userList) { QueryWrapper wrapper=new QueryWrapper<>(); if(userResord.getId()!=null){ wrapper.eq("id", userResord.getId()); employeeMapper.update(userResord,wrapper) ; }else { employeeMapper.insert(userResord); } } return notNull; } ```