package com.fzzy.igds.service;
|
|
import com.ruoyi.common.config.FrameworkConfig;
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
import org.springframework.stereotype.Service;
|
import com.ruoyi.common.utils.StringUtils;
|
|
import java.io.File;
|
import java.util.Date;
|
|
/**
|
* @Description
|
* @Author CZT
|
* @Date 2025/12/4 17:36
|
*/
|
@Service
|
public class FileService {
|
|
/**
|
* 获取出入库文件路径
|
* @param date
|
* @return
|
*/
|
public String getInoutFilePath(Date date) {
|
if (null == date) date = new Date();
|
String basePath = FrameworkConfig.getProfile() + "INOUT/" + DateFormatUtils.format(date, "yyyyMM") + "/";
|
File file = new File(basePath);
|
if (!file.exists()) {
|
file.mkdirs();
|
}
|
return basePath;
|
}
|
|
/**
|
* 获取库区路径下文件
|
* @param companyId
|
* @return
|
*/
|
public String getDeptFilePath(String companyId) {
|
if (StringUtils.isEmpty(companyId)){
|
companyId = FrameworkConfig.getCompanyId();
|
}
|
|
String basePath = FrameworkConfig.getProfile() + "IMG/"+ companyId + "/SECURITY/";
|
|
File file = new File(basePath);
|
if (!file.exists()) {
|
file.mkdirs();
|
}
|
return basePath;
|
}
|
}
|