|
@@ -420,6 +420,8 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
|
|
|
MouldFile file = mouldFileMapper.selectById(projectFile.getId());
|
|
|
MouldOperationDynamics dynamics = new MouldOperationDynamics();
|
|
|
dynamics.setContent(Constant.DOWNLOAD);
|
|
|
+ dynamics.setApplicantId(file.getUplodtorId());
|
|
|
+ dynamics.setApplicantName(file.getUploadtor());
|
|
|
dynamics.setFileName(file.getFileName());
|
|
|
dynamics.setOperatorId(user.getId());
|
|
|
dynamics.setOperatorName(user.getUsername());
|
|
@@ -532,6 +534,7 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
|
|
|
@Override
|
|
|
public HttpRespMsg dowloadFileList(UserVO userVO, HttpServletRequest request, HttpServletResponse response, String downloadPath, String path) throws IOException {
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ User currentUser = userMapper.selectOne(new QueryWrapper<User>().eq("head_imgurl", userVO.getToken()));
|
|
|
if (null != userVO.getIds()) {
|
|
|
List<Integer> ids = ListUtil.convertIntegerIdsArrayToList(userVO.getIds());
|
|
|
List<MouldFile> mouldFiles = new ArrayList<>();
|
|
@@ -555,7 +558,7 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
|
|
|
mouldFiles = mouldFileMapper.selectList(new QueryWrapper<MouldFile>().eq("model_id", id).eq("state", 3).eq("blong_type",3));
|
|
|
}
|
|
|
// feedBackDirectMultiDownload(request, response, downloadPath, mould, mouldFiles, path);
|
|
|
- String filePath = this.download(downloadPath, mould, mouldFiles, path);
|
|
|
+ String filePath = this.download(downloadPath, mould, mouldFiles, path,currentUser);
|
|
|
msg.data = filePath;
|
|
|
}
|
|
|
}
|
|
@@ -738,7 +741,7 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
|
|
|
}
|
|
|
|
|
|
|
|
|
- public String download(String downloadPath, Mould vo, List<MouldFile> mouldFiles, String oldFilePath){
|
|
|
+ public String download(String downloadPath, Mould vo, List<MouldFile> mouldFiles, String oldFilePath, User user){
|
|
|
//需要压缩的文件--包括文件地址和文件名
|
|
|
// 要生成的压缩文件地址和文件名称
|
|
|
String desPath = oldFilePath+vo.getModelNo() + vo.getModelName()+".zip";
|
|
@@ -751,6 +754,18 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
|
|
|
zipStream = new ZipOutputStream(new FileOutputStream(zipFile));
|
|
|
if(mouldFiles.size()>0){
|
|
|
for(int i =0;i<mouldFiles.size();i++){
|
|
|
+ //添加下载动态
|
|
|
+ MouldOperationDynamics mod = new MouldOperationDynamics();
|
|
|
+ mod.setApplicantId(mouldFiles.get(i).getUplodtorId());
|
|
|
+ mod.setApplicantName(mouldFiles.get(i).getUploadtor());
|
|
|
+ mod.setFileName(mouldFiles.get(i).getFileName());
|
|
|
+ mod.setOperatorId(user.getId());
|
|
|
+ mod.setOperatorName(user.getUsername());
|
|
|
+ mod.setContent(Constant.DOWNLOAD);
|
|
|
+ mod.setFileId(mouldFiles.get(i).getId());
|
|
|
+ mod.setMouldId(vo.getId());
|
|
|
+ mod.setBelongType(mouldFiles.get(i).getBlongType());
|
|
|
+ mouldOperationDynamicsMapper.insert(mod);
|
|
|
File file = new File(oldFilePath.substring(0, oldFilePath.length() - "/upload/".length())+mouldFiles.get(i).getFileUrl());
|
|
|
//将需要压缩的文件格式化为输入流
|
|
|
zipSource = new FileInputStream(file);
|