管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-12-23 43863b3aa96e223fa3835245ad0d2c932bf63559
src/main/java/com/lf/server/controller/show/ExportController.java
@@ -11,6 +11,7 @@
import com.lf.server.helper.WebHelper;
import com.lf.server.service.data.DownloadService;
import com.lf.server.service.show.ExportService;
import com.lf.server.service.sys.DownlogService;
import com.lf.server.service.sys.TokenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -36,6 +37,9 @@
    @Autowired
    ExportService exportService;
    @Autowired
    DownlogService downlogService;
    @Autowired
    DownloadService downloadService;
@@ -117,16 +121,14 @@
                return;
            }
            UserEntity ue = tokenService.getCurrentUser(req);
            DownloadEntity de = downloadService.selectByGuid(guid);
            if (null == de) {
                WebHelper.writeInfo(HttpStatus.NOT_FOUND, "文件不存在", res);
                return;
            }
            de.setDcount(de.getDcount() + 1);
            de.setDownloadUser(ue.getId());
            int rows = downloadService.update(de);
            UserEntity ue = tokenService.getCurrentUser(req);
            downlogService.updateInfos(ue, de, req);
            String filePath = downloadService.getDownloadFilePath(de);
            WebHelper.download(filePath, de.getName(), res);