| | |
| | | } |
| | | |
| | | @Override |
| | | public String getSnapFilePath(Date date) { |
| | | if (null == date) date = new Date(); |
| | | String basePath = configData.getFilePath() + "SNAP/" + DateFormatUtils.format(date, "yyyyMM") + "/"; |
| | | File file = new File(basePath); |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | return basePath; |
| | | } |
| | | |
| | | @Override |
| | | public String getSnapFilePath(String dateStr) { |
| | | if (null == dateStr) return null; |
| | | |
| | | if(dateStr.length()>6) dateStr = dateStr.substring(0, 6); |
| | | |
| | | String basePath = configData.getFilePath() + "SNAP/" + dateStr+ "/"; |
| | | File file = new File(basePath); |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | return basePath; |
| | | } |
| | | |
| | | @Override |
| | | public String getCommonFilePath(Date date) { |
| | | if (null == date) |
| | | date = new Date(); |
| | |
| | | } |
| | | data.setCreateTime(new Date()); |
| | | data.setBizId(bizId); |
| | | if (StringUtils.isNotEmpty(bizTag)) { |
| | | data.setBizTag(bizTag); |
| | | } |
| | | data.setCompanyId(companyId); |
| | | data.setFileId(ContextUtil.getUUID()); |
| | | fileServiceMapper.addFile(data); |