whycxzp
2022-07-29 c32fc03c330b1bc4f0b6b28286addf201c9c4f99
更新工作流
2个文件已修改
18 ■■■■ 已修改文件
src/main/java/com/whyc/service/WorksheetLinkService.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ProductBomMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/WorksheetLinkService.java
@@ -190,22 +190,22 @@
                    String dwgUrl = fileBom.getDwgUrl();
                    if(pictureUrl !=null){
                        String newPictureUrl ="doc_file"+File.separator+"product"+File.separator+fileBom.getParentModel()+File.separator+ pictureUrl.substring(pictureUrl.lastIndexOf(File.separator)+1);
                        File newPictureFile = new File(projectDir + File.separator + newPictureUrl);
                        if(!newPictureFile.exists()){
                            newPictureFile.mkdirs();
                        File newPictureDir = new File(projectDir + File.separator + "doc_file"+File.separator+"product"+File.separator+fileBom.getParentModel());
                        if(!newPictureDir.exists()){
                            newPictureDir.mkdirs();
                        }
                        FileCopyUtils.copy(new File(projectDir+File.separator+ pictureUrl),
                                newPictureFile);
                                new File(projectDir+File.separator+newPictureUrl));
                        fileBom.setPictureUrl(newPictureUrl);
                    }
                    if(dwgUrl !=null){
                        String newDwgUrl ="doc_file"+File.separator+"product"+File.separator+fileBom.getParentModel()+File.separator+ dwgUrl.substring(dwgUrl.lastIndexOf(File.separator)+1);
                        File newDwgFile = new File(projectDir + File.separator + newDwgUrl);
                        if(!newDwgFile.exists()){
                            newDwgFile.mkdirs();
                        File newDwgDir = new File(projectDir + File.separator + "doc_file"+File.separator+"product"+File.separator+fileBom.getParentModel());
                        if(!newDwgDir.exists()){
                            newDwgDir.mkdirs();
                        }
                        FileCopyUtils.copy(new File(projectDir+File.separator+ dwgUrl),
                                newDwgFile);
                                new File(newDwgUrl));
                        fileBom.setDwgUrl(newDwgUrl);
                    }
                } catch (IOException e) {
src/main/resources/mapper/ProductBomMapper.xml
@@ -4,7 +4,7 @@
    <update id="updateUrl">
        <foreach collection="list" item="item" separator=";">
            update db_doc.tb_product_bom set picture_url = #{item.pictureUrl},dwg_url = #{item.dwgUrl}
            where parent_model = #{item.parentModel} and sub_model = #{item.subModel} and id !=0;
            where parent_model = #{item.parentModel} and sub_model = #{item.subModel} and id !=0
        </foreach>
    </update>