whyclxw
2025-06-16 f52250bf50ff68865a35cdc5c69f6fade2d51156
src/main/java/com/whyc/service/BomAcceptanceService.java
@@ -210,7 +210,6 @@
    }
   //删除图
    public void delPic(int num, int picNum,String picUrl,String newPicUrl) {
        String rootFile = CommonUtil.getRootFile();//主路径
        UpdateWrapper wrapper=new UpdateWrapper();
        wrapper.eq("num",num);
        if(picNum==1){
@@ -232,8 +231,9 @@
            wrapper.set("bom_agreement",newPicUrl);
        }
        int flag=mapper.update(null,wrapper);
        if(flag>0){
            rootFile=rootFile.replace("doc_file","");
        if(flag>0&&picUrl.length()>0){
            String rootFile = CommonUtil.getRootFile();//主路径
            picUrl=picUrl.replace("doc_file","");
            //删除图片
            FileUtil.deleteFile(new File(rootFile+picUrl));
        }
@@ -265,7 +265,7 @@
        if(picNum==6){
            picUrl=bomAcceptance.getBomAgreement();
        }
        //后面图
       //后面图
        if(filePic!=null){
            //存储文件
            String originalFilename = filePic.getOriginalFilename();
@@ -285,7 +285,6 @@
    //编辑多个图片上传
    public Response updatePartPic(List<MultipartFile> multipartFileList, int num) throws IOException {
        String rootFile = CommonUtil.getRootFile();
        rootFile=rootFile.replace("doc_file","");
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.eq("num",num);
        wrapper.last("limit 1");
@@ -329,19 +328,10 @@
        }
        String devRoot=rootFile.replace("doc_file", "");
        List<String> devPicList=new ArrayList<>();
        if(bomAcceptance.getDevPicleft()!=null||!bomAcceptance.getDevPicleft().isEmpty()){
            devPicList.add(bomAcceptance.getDevPicleft());
        }
        if(bomAcceptance.getDevPicright()!=null||!bomAcceptance.getDevPicright().isEmpty()){
            devPicList.add(bomAcceptance.getDevPicright());
        }
        if(bomAcceptance.getDevPicfront()!=null||!bomAcceptance.getDevPicfront().isEmpty()){
            devPicList.add(bomAcceptance.getDevPicfront());
        }
        if(bomAcceptance.getDevPicback()!=null||!bomAcceptance.getDevPicback().isEmpty()){
            devPicList.add(bomAcceptance.getDevPicback());
        }
        devPicList.add(bomAcceptance.getDevPicleft());
        devPicList.add(bomAcceptance.getDevPicfront());
        devPicList.add(bomAcceptance.getDevPicright());
        devPicList.add(bomAcceptance.getDevPicback());
        String fileName="产品验收信息记录";
        //创建单个sheet
        HSSFWorkbook wb = new HSSFWorkbook();
@@ -469,6 +459,9 @@
            ByteArrayOutputStream byteArrayOut = null;
            for(int i=0;i<devPicList.size();i++){
                String picUrl=devPicList.get(i);
                if(picUrl.length()==0){
                    continue;
                }
                try {
                    byteArrayOut = new ByteArrayOutputStream();
                    String path=devRoot+File.separator+picUrl;