lxw
2023-09-19 59fb1df6902d467edc9cb397efdf214eac604253
src/main/java/com/whyc/service/ProductBomService.java
@@ -27,6 +27,7 @@
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedList;
@@ -286,12 +287,6 @@
        }
        //生成excel并将dwg文件放在同一报下压缩
        creatBomExcel(req,resp,product,endList,wb,withOutDwg);
        //记录日志
        DocUser docUser= ActionUtil.getUser();
        String operationDetail="具体产品信息为:"+product.toString();
        String opreationMsg="执行了最新版产品下载操作";
        String terminalIp=req.getRemoteAddr();
        logService.recordOperationLog(docUser.getId(),docUser.getName(), UserOperation.TYPE_DOWNLOAD.getType(),new Date(),terminalIp,opreationMsg,operationDetail);
    }
@@ -486,9 +481,10 @@
            ZipUtils.toZip(rootFace, forootFace,true);
            // 转码防止乱码
            resp.addHeader("Content-Disposition", "attachment;filename="
            /*resp.addHeader("Content-Disposition", "attachment;filename="
                    + new String(excelName.getBytes("UTF-8"), "ISO8859-1")
                    + ".zip");
                    + ".zip");*/
            resp.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode (excelName+".zip", "utf-8"));
            OutputStream out = resp.getOutputStream();
            FileInputStream in = new FileInputStream(rootFace+".zip");
            int len=0;
@@ -506,6 +502,8 @@
        } catch (IOException e) {
            e.printStackTrace();
        }
        //记录日志
        logService.recordOperationLog(ActionUtil.getUser().getId(),ActionUtil.getUser().getName(), UserOperation.TYPE_DOWNLOAD_New.getType(),new Date(),req.getRemoteAddr(),excelName,rootFace+".zip");
    }
    //查询所有产品中没有与指定散装件关联的子件
    public Response getAllSubWithOutMaterial(int materialId) {