whycxzp
2022-09-07 fc19278b9ec34d1a0771da5c3b7d92d7cf6d90f7
src/main/java/com/whyc/service/SoftwareService.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whyc.constant.UserOperation;
import com.whyc.dto.FileDirPath;
import com.whyc.dto.Response;
@@ -99,7 +100,8 @@
        wrapper.orderByAsc("file_name");
        wrapper.orderByAsc("version");
        List list=mapper.selectList(wrapper);
        return new Response().setII(1,list.size()>0,list,"软件信息返回");
        PageInfo pageInfo=new PageInfo(list);
        return new Response().setII(1,list.size()>0,pageInfo,"软件信息返回");
    }
    //根据subcode查询软件列表
    public Response getSoftBySubCode(String subCode) {
@@ -121,7 +123,7 @@
        try {
            // 转码防止乱码
            //resp.addHeader("Content-Disposition", "attachment;filename=" + new String(softwareName.getBytes("UTF-8"), "ISO8859-1"));
            resp.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode ( software.getFileName(), "utf-8"));
            resp.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode ( software.getFileName()+".zip", "utf-8"));
            OutputStream out = resp.getOutputStream();
            FileInputStream in = new FileInputStream(fileDirName+File.separator+software.getFileUrl());
            int len=0;
@@ -156,7 +158,7 @@
        file2Name = file2Name.substring(0,file2Name.lastIndexOf(".")) + "_" + dateUnion +file2Name.substring(file2Name.lastIndexOf("."));
        //存储路径
        String rootFile = CommonUtil.getRootFile();
        String softwareDir = rootFile + "software" + File.separator + software.getOwner() + File.separator + dateUnion;
        String softwareDir = rootFile + "software" + File.separator + software.getOwner();
        String softwareHttpUrl = softwareDir.substring(softwareDir.lastIndexOf("doc_file"+ File.separator + "software"));
        File softwareDirFile = new File(softwareDir);
        if(!softwareDirFile.exists()){