| | |
| | | } |
| | | //删除图 |
| | | 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){ |
| | |
| | | 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)); |
| | | } |
| | |
| | | if(picNum==6){ |
| | | picUrl=bomAcceptance.getBomAgreement(); |
| | | } |
| | | //后面图 |
| | | //后面图 |
| | | if(filePic!=null){ |
| | | //存储文件 |
| | | String originalFilename = filePic.getOriginalFilename(); |
| | |
| | | cell.setCellValue("端口协议文本"); |
| | | cell.setCellStyle(cellStyle); |
| | | cell=row.createCell(1); |
| | | if(bomAcceptance.getBomAgreement()!=null||!bomAcceptance.getBomAgreement().equals("")){ |
| | | if(bomAcceptance.getBomAgreement()!=null&&bomAcceptance.getBomAgreement().length()>0){ |
| | | 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); |
| | | } |