From 97b46c01f1d142780c2fc455bdb2b003f8141e93 Mon Sep 17 00:00:00 2001 From: lxw <810412026@qq.com> Date: 星期四, 17 十一月 2022 12:42:02 +0800 Subject: [PATCH] //根据产品母料型号,定制单号,版本下载原始压缩包文件 --- src/main/java/com/whyc/service/ProductBomHistoryService.java | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/whyc/service/ProductBomHistoryService.java b/src/main/java/com/whyc/service/ProductBomHistoryService.java index 92916f5..2935ea5 100644 --- a/src/main/java/com/whyc/service/ProductBomHistoryService.java +++ b/src/main/java/com/whyc/service/ProductBomHistoryService.java @@ -610,4 +610,29 @@ mapper.updateMaterialField2BomHistoryBatch(bomHistoryList); } + //鏍规嵁浜у搧姣嶆枡鍨嬪彿锛屽畾鍒跺崟鍙凤紝鐗堟湰涓嬭浇鍘熷鍘嬬缉鍖呮枃浠� + public Response getOriginalZip(String parentModel, String customCode, int version) { + String fileDirName = FileDirPath.getFileDirName(); + String withOutDwg=fileDirName+File.separator+"doc_file"+File.separator+"product"+File.separator+parentModel; + if(customCode!=null&&!customCode.isEmpty()){ + withOutDwg+=File.separator+customCode+File.separator+version; + }else{ + withOutDwg+=File.separator+"standard"+File.separator+version; + } + boolean bl=false; + File file = new File(withOutDwg); + if(!file.exists()) { + return new Response().setII(1,bl,withOutDwg.replace(fileDirName,""),"鍘熷鏂囦欢鐩稿璺緞"); + } + String[] filePath = file.list();//鑾峰彇璇ユ枃浠跺す涓嬬殑鎵�鏈夋枃浠朵互鍙婄洰褰曠殑鍚嶅瓧 + if(filePath!=null&&filePath.length>0){ + for (String tmp:filePath) { + if(tmp.contains(".zip")){ + bl=true; + withOutDwg=withOutDwg+File.separator+tmp; + } + } + } + return new Response().setII(1,bl,withOutDwg.replace(fileDirName,""),"鍘熷鏂囦欢鐩稿璺緞"); + } } -- Gitblit v1.9.1