whyclxw
2025-06-16 409c2d80badf33912ec785f5cf1413df917a85cb
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();
@@ -536,7 +536,8 @@
        cell=row.createCell(1);
        if(bomAcceptance.getBomAgreement()!=null||!bomAcceptance.getBomAgreement().equals("")){
            String agreement=bomAcceptance.getBomAgreement();
            String agreementName = agreement.substring(agreement.lastIndexOf(".")+1);
            String agreementName = agreement.substring(agreement.lastIndexOf(File.separator)+1);
            agreementName = agreementName.substring(0,agreementName.lastIndexOf("."));
            cell.setCellValue(agreementName);
            cell.setCellStyle(cellStyle);
        }