lxw
2022-09-29 4deaba7a9924c132cea872440da7f2894c7e5d16
产品下载不包含带有bom的图片
1个文件已修改
29 ■■■■■ 已修改文件
src/main/java/com/whyc/service/ProductBomService.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/ProductBomService.java
@@ -191,7 +191,7 @@
        }
    }
    //文件夹的拷贝移除productId对应的多送项
    //文件夹的拷贝移除productId对应的被锁定的
    public  void copyDirWithOutProductId(String sourcePathDir, String newPathDir,int productId) {
        File start = new File(sourcePathDir);
        File end = new File(newPathDir);
@@ -204,17 +204,22 @@
        }
        if(filePath.length>=0){
            for(String temp : filePath) {
                //添加满足情况的条件
                if(new File(sourcePathDir + File.separator + temp ).isFile()) {
                    QueryWrapper wrapper=new QueryWrapper();
                    wrapper.eq("product_id",productId);
                    wrapper.eq("attach_name",temp);
                    wrapper.eq("lock_flag",1);
                    wrapper.last("limit 1");
                    AttachLock attachLock=attachLockMapper.selectOne(wrapper);
                    if(attachLock==null){
                        //为文件则进行拷贝
                        copyFile(new File(sourcePathDir + File.separator + temp ), newPathDir );
                //产品下载不包含带有bom的图片
                if(temp.contains("bom")){
                    continue;
                }else{
                    //添加满足情况的条件
                    if(new File(sourcePathDir + File.separator + temp ).isFile()) {
                        QueryWrapper wrapper=new QueryWrapper();
                        wrapper.eq("product_id",productId);
                        wrapper.eq("attach_name",temp);
                        wrapper.eq("lock_flag",1);
                        wrapper.last("limit 1");
                        AttachLock attachLock=attachLockMapper.selectOne(wrapper);
                        if(attachLock==null){
                            //为文件则进行拷贝
                            copyFile(new File(sourcePathDir + File.separator + temp ), newPathDir );
                        }
                    }
                }
            }