| | |
| | | import com.whyc.pojo.*; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.DateUtil; |
| | | import com.whyc.util.ThreadLocalUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.system.ApplicationHome; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | fileDirName = jarFile.toString(); |
| | | } |
| | | //文件夹按月度存储 |
| | | String root=fileDirName+"/fg_file/alarm_manual_clear/"+ DateUtil.YYYY_MM.format(date) + "/"; |
| | | //String root=fileDirName+"/fg_file/alarm_manual_clear/"+ DateUtil.YYYY_MM.format(date) + "/"; |
| | | String root=fileDirName+"/fg_file/alarm_manual_clear/"+ ThreadLocalUtil.format(date,5) + "/"; |
| | | List<String> filePathList = new ArrayList<>(); |
| | | try { |
| | | for (int i = 0; i < file.size(); i++) { |
| | | String fileFileName = file.get(i).getOriginalFilename(); |
| | | String filePath = root + DateUtil.YYYY_MM_DD_HH_MM_SS_UNION.format(date)+"_"+fileFileName; |
| | | //String filePath = root + DateUtil.YYYY_MM_DD_HH_MM_SS_UNION.format(date)+"_"+fileFileName; |
| | | String filePath = root + ThreadLocalUtil.format(date,7)+"_"+fileFileName; |
| | | createFilefolderIFNotExist(filePath); |
| | | file.get(i).transferTo(new File(filePath)); |
| | | String httpFilePath = filePath.replace(fileDirName, ""); |
| | |
| | | }); |
| | | return new Response().set(1,pageInfo); |
| | | } |
| | | |
| | | /** |
| | | * 查询实施表中所有的main_id |
| | | * @return |
| | | */ |
| | | public List<Integer> getAllMainIds(){ |
| | | return mapper.getAllMainIds(); |
| | | } |
| | | } |