Commit 0dbf6a25 authored by yanzg's avatar yanzg

下载视频

parent c58c5e3e
......@@ -98,7 +98,7 @@ public class YzgFileVo extends BaseVo implements InitDao {
this.fileStatus = StringHelper.getFirst(this.fileStatus);
this.fileRow = StringHelper.getFirst(this.fileRow);
this.errorMessage = StringHelper.getFirst(this.errorMessage);
this.downloadDate = StringHelper.getFirst(this.downloadDate);
this.downloadDate = StringHelper.getFirstNull(this.downloadDate);
this.downloadUserId = StringHelper.getFirst(this.downloadUserId);
this.createDate = StringHelper.getFirst(this.createDate, DateHelper.getNow());
this.createUserId = StringHelper.getFirst(this.createUserId);
......
......@@ -108,7 +108,7 @@ public class YzgExcelService {
* @param response
* @throws IOException
*/
public void donwload(YzgFileDownloadReqVo req, HttpServletResponse response) throws IOException {
public void donwload(YzgFileDownloadReqVo req, String downloadUserId, HttpServletResponse response) throws IOException {
YzgFileVo load = fileDao.load(req, YzgFileVo.class);
if (load == null) {
throw new CodeException("文件不存在或者已经删除");
......@@ -124,6 +124,9 @@ public class YzgExcelService {
if (!file.exists()) {
throw new CodeException("文件已经被删除,或者服务器之间没有共享文件目录");
}
load.setDownloadDate(DateHelper.getNow());
load.setDownloadUserId(downloadUserId);
fileDao.update(load);
HttpFileHelper.localToDown(serverPath, load.getFileName() + ".xlsx", response);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment