管道基础大数据平台系统开发-【后端】-Server
1.6
13693261870
2023-01-06 d12b5b41ee33e7eb57f3c3fe00f4fae53eb93388
src/main/java/com/lf/server/controller/show/DataLibController.java
@@ -10,10 +10,8 @@
import com.lf.server.entity.all.ResponseMsg;
import com.lf.server.entity.all.StaticData;
import com.lf.server.entity.ctrl.DownloadReqEntity;
import com.lf.server.entity.data.DictEntity;
import com.lf.server.entity.data.DownloadEntity;
import com.lf.server.entity.data.MetaEntity;
import com.lf.server.entity.data.MetaFileEntity;
import com.lf.server.entity.sys.UserEntity;
import com.lf.server.helper.*;
import com.lf.server.mapper.all.BasicMapper;
@@ -21,6 +19,7 @@
import com.lf.server.service.data.DownloadService;
import com.lf.server.service.data.MetaService;
import com.lf.server.service.show.DataLibService;
import com.lf.server.service.sys.DownlogService;
import com.lf.server.service.sys.TokenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -52,6 +51,9 @@
    @Autowired
    DataLibService dataLibService;
    @Autowired
    DownlogService downlogService;
    @Autowired
    DownloadService downloadService;
@@ -104,11 +106,11 @@
            }
            MetaEntity meta = metaService.selectById(id);
            if (null == meta || null == meta.getTab() || !meta.getTab().contains(StaticData.POINT)) {
            if (null == meta || null == meta.getBstab() || !meta.getBstab().contains(StaticData.POINT)) {
                return fail("找不到元数据信息", null);
            }
            String entity = meta.getTab().substring(meta.getTab().indexOf(".") + 1).replace("_", "").toLowerCase();
            String entity = meta.getBstab().substring(meta.getBstab().indexOf(".") + 1).replace("_", "").toLowerCase();
            BasicMapper baseMapper = ClassHelper.getBasicMapper(entity);
            if (null == baseMapper) {
                return null;
@@ -146,14 +148,14 @@
            if (null == reqEntity.getIds() || reqEntity.getIds().isEmpty()) {
                return fail("请选择要下载的文件");
            }
            if (!downloadService.decryptPwd(reqEntity)) {
            if (!DownloadService.decryptPwd(reqEntity)) {
                return fail("密码解密失败", null);
            }
            if (!StringHelper.checkPwdValid(reqEntity.getPwd())) {
            if (StringHelper.isPwdInvalid(reqEntity.getPwd())) {
                return fail("密码不符合要求");
            }
            List<MetaFileEntity> list = metaService.selectMetaFiles(reqEntity.getIds());
            List<MetaEntity> list = metaService.selectMetaFiles(reqEntity.getIds());
            if (null == list || list.isEmpty()) {
                return fail("没有找到元数据");
            }
@@ -183,7 +185,7 @@
                pwd = URLDecoder.decode(pwd, StandardCharsets.UTF_8.name());
            }
            String password = downloadService.decryptPwd(pwd);
            String password = DownloadService.decryptPwd(pwd);
            if (null == password) {
                return fail("密码解密失败", null);
            }
@@ -222,7 +224,7 @@
                pwd = URLDecoder.decode(pwd, StandardCharsets.UTF_8.name());
            }
            String password = downloadService.decryptPwd(pwd);
            String password = DownloadService.decryptPwd(pwd);
            if (null == password) {
                WebHelper.writeInfo(HttpStatus.BAD_REQUEST, "密码解密失败", res);
            }
@@ -237,9 +239,7 @@
            }
            UserEntity ue = tokenService.getCurrentUser(req);
            de.setDcount(de.getDcount() + 1);
            de.setDownloadUser(ue.getId());
            int rows = downloadService.update(de);
            downlogService.updateInfos(ue, de, req);
            String filePath = downloadService.getDownloadFilePath(de);
            WebHelper.download(filePath, de.getName(), res);