| | |
| | | import com.whyc.pojo.*; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.CommonUtil; |
| | | import com.whyc.util.DwgToPngUtil; |
| | | import com.whyc.util.ImageDiff; |
| | | import org.apache.poi.hssf.usermodel.*; |
| | | import org.apache.poi.ss.usermodel.ClientAnchor; |
| | |
| | | //如果物料一致,则进行对比 |
| | | String dwgUrlInDB = materialInDB.getDwgUrl(); |
| | | String dwgUrl = material.getDwgUrl(); |
| | | //物料图纸转化为png图片进行对比 |
| | | //物料图纸转化为png图片进行对比(弃用) |
| | | String dwgFileStr = CommonUtil.getProjectDir() + File.separator + dwgUrlInDB; |
| | | String dwgFileStr2 = CommonUtil.getProjectDir() + File.separator + dwgUrl; |
| | | |
| | | String absoluteDwgPngPath = dwgFileStr.substring(0, dwgFileStr.lastIndexOf(".")) + "-dwg.png"; |
| | | /*String absoluteDwgPngPath = dwgFileStr.substring(0, dwgFileStr.lastIndexOf(".")) + "-dwg.png"; |
| | | String absoluteDwgPngPath2 = dwgFileStr2.substring(0, dwgFileStr2.lastIndexOf(".")) + "-dwg.png"; |
| | | |
| | | if (!new File(absoluteDwgPngPath).exists()) { |
| | |
| | | } |
| | | if (!new File(absoluteDwgPngPath2).exists()) { |
| | | DwgToPngUtil.dwg2png(new File(dwgFileStr2)); |
| | | } |
| | | boolean sameImage = ImageDiff.compareImagesCheck(absoluteDwgPngPath, absoluteDwgPngPath2); |
| | | }*/ |
| | | boolean sameImage = ImageDiff.compareImagesCheck(dwgFileStr, dwgFileStr2); |
| | | if (!sameImage) { //图纸不同 |
| | | material.setNotes(absoluteDwgPngPath.replace(CommonUtil.getProjectDir()+ File.separator, "") + separator + absoluteDwgPngPath2.replace(CommonUtil.getProjectDir()+ File.separator, "")); |
| | | //material.setNotes(absoluteDwgPngPath.replace(CommonUtil.getProjectDir()+ File.separator, "") + separator + absoluteDwgPngPath2.replace(CommonUtil.getProjectDir()+ File.separator, "")); |
| | | material.setNotes(dwgUrlInDB); |
| | | diffDwgList.add(material); |
| | | } |
| | | |