退料申请表数据问题修改

This commit is contained in:
liang.chao 2024-03-14 09:09:03 +08:00
parent edb2b4ed9f
commit c5475985b9
2 changed files with 9 additions and 3 deletions

View File

@ -72,7 +72,7 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
@Override @Override
public List<String> getFileUrl(String fileIds) { public List<String> getFileUrl(String fileIds) {
List<String> fileUrlList = new ArrayList<>(); List<String> fileUrlList = new ArrayList<>();
if (fileIds!=null &&fileIds.isEmpty()){ if (fileIds != null && !fileIds.isEmpty()) {
for (String s : fileIds.split(",")) { for (String s : fileIds.split(",")) {
String url = scrapApplyDetailsMapper.getFileUrl(s); String url = scrapApplyDetailsMapper.getFileUrl(s);
fileUrlList.add(url); fileUrlList.add(url);

View File

@ -12,6 +12,7 @@ import org.apache.poi.hwpf.extractor.WordExtractor;
import org.apache.poi.openxml4j.util.ZipSecureFile; import org.apache.poi.openxml4j.util.ZipSecureFile;
import org.apache.poi.xwpf.extractor.XWPFWordExtractor; import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -37,6 +38,11 @@ public class SysFileServiceImpl implements SysFileService {
@Resource @Resource
private FileInfoMapper dao; private FileInfoMapper dao;
/**
* 上传文件存储在本地的根路径
*/
@Value("${file.path}")
private String localFilePath;
/** /**
* 本地文件上传接口 * 本地文件上传接口
@ -133,7 +139,7 @@ public class SysFileServiceImpl implements SysFileService {
String tmpName = multipartFile.getOriginalFilename(); String tmpName = multipartFile.getOriginalFilename();
tmpName = tmpName.substring(tmpName.lastIndexOf("\\") + 1); tmpName = tmpName.substring(tmpName.lastIndexOf("\\") + 1);
tmpName = IdUtil.fastSimpleUUID() + System.currentTimeMillis() + tmpName.substring(tmpName.lastIndexOf("."), tmpName.length()); tmpName = IdUtil.fastSimpleUUID() + System.currentTimeMillis() + tmpName.substring(tmpName.lastIndexOf("."), tmpName.length());
String imageFiles = "/data/sgzb/" + fileType + "/"; String imageFiles = localFilePath + fileType + "/";
String os = System.getProperty("os.name"); String os = System.getProperty("os.name");
if (os.toLowerCase().startsWith(GlobalConstants.STRING_WIN)) { if (os.toLowerCase().startsWith(GlobalConstants.STRING_WIN)) {
imageFiles = "D://files/" + fileType + "/"; imageFiles = "D://files/" + fileType + "/";
@ -172,7 +178,7 @@ public class SysFileServiceImpl implements SysFileService {
String tmpName = multipartFile.getOriginalFilename(); String tmpName = multipartFile.getOriginalFilename();
tmpName = tmpName.substring(tmpName.lastIndexOf("\\") + 1); tmpName = tmpName.substring(tmpName.lastIndexOf("\\") + 1);
tmpName = IdUtil.fastSimpleUUID() + System.currentTimeMillis() + tmpName.substring(tmpName.lastIndexOf("."), tmpName.length()); tmpName = IdUtil.fastSimpleUUID() + System.currentTimeMillis() + tmpName.substring(tmpName.lastIndexOf("."), tmpName.length());
String imageFiles = "/data/sgzb/" + fileType + "/"; String imageFiles = localFilePath + fileType + "/";
String os = System.getProperty("os.name"); String os = System.getProperty("os.name");
if (os.toLowerCase().startsWith(GlobalConstants.STRING_WIN)) { if (os.toLowerCase().startsWith(GlobalConstants.STRING_WIN)) {
imageFiles = "D://files/" + fileType + "/"; imageFiles = "D://files/" + fileType + "/";