whyclxw
2025-05-28 e16302f9d475c7cc4dd18c5abf1a23cb5502e362
src/main/java/com/whyc/service/AlarmManualClearService.java
@@ -11,6 +11,7 @@
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;
@@ -92,12 +93,14 @@
            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, "");
@@ -164,4 +167,12 @@
        });
        return new Response().set(1,pageInfo);
    }
    /**
     *  查询实施表中所有的main_id
     * @return
     */
    public List<Integer> getAllMainIds(){
        return mapper.getAllMainIds();
    }
}