| | |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.sun.jna.platform.mac.MacFileUtils; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | import org.springframework.beans.BeansException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.ApplicationContext; |
| | |
| | | String filePath = fileService.getInoutFilePath(); |
| | | |
| | | // 获取新的ID |
| | | String newFileName = ContextUtil.UUID(); |
| | | String newFileName = DateFormatUtils.format(new Date(), "yyyyMMddHHmmssSSS"); |
| | | |
| | | // 文件后缀名 |
| | | String suffixName = oldFileName.substring(oldFileName.lastIndexOf(".")); |
| | | |
| | | // 合成新的文件名 |
| | | if (StringUtils.isEmpty(plateNum)) { |
| | | newFileName = newFileName + suffixName; |
| | | } else { |
| | | newFileName = plateNum + "_" + newFileName + suffixName; |
| | | } |
| | | |
| | | // 文件上传 |
| | | boolean flag = uploadFile(fileByte, filePath, newFileName); |
| | |
| | | String filePath = fileService.getPatrolFilePath(); |
| | | |
| | | // 获取新的ID |
| | | String newFileName = DateUtils.dateTimeNow(); |
| | | String newFileName = DateFormatUtils.format(new Date(), "yyyyMMddHHmmssSSS"); |
| | | |
| | | // 文件后缀名 |
| | | String suffixName = oldFileName.substring(oldFileName.lastIndexOf(".")); |