From 96c143b25abeda94c8a01b72ff4665e93a8c3ae6 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 3 Apr 2023 10:15:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../idc/service/impl/IdcServiceImpl.java | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/idc/service/impl/IdcServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/idc/service/impl/IdcServiceImpl.java index 5cf1cc8..a31f426 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/idc/service/impl/IdcServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/idc/service/impl/IdcServiceImpl.java @@ -79,7 +79,7 @@ public class IdcServiceImpl implements IdcService { "//sup_cert_set/id///updateTime///供应商资质证书设置","companyCert//sup_company/customerId///updateTime///配送企业", "manufacturerCert//sup_manufacturer/id///updateTime///生产企业","productCert//sup_product/id///updateTime///产品资质信息", "//udicompany/id///updateTime///国际库医疗器械注册人信息"}; - //"dbDiProducts//productinfo/id///updateTime///DI产品信息", + //"dbDiProducts//productinfo/id///updateTime///DI产品信息", private int orderNum=0; @Resource @@ -338,14 +338,15 @@ public class IdcServiceImpl implements IdcService { String secretKey = request.getHeader("secretKey"); /*******/ JSONObject json = JSONObject.parseObject(content); - + String filePathSlash = filePath.substring(filePath.length() -1).equals("/") ? "" : "/"; + String backFileSlash = backFilePath.substring(filePath.length() -1).equals("/") ? "" : "/"; String datePath = DateUtil.formatDate(new Date(),"yyyy-MM-dd"); - String fileName = filePath +datePath+"/"+json.getString("messageType")+"-"+json.getString("messageId")+".udi"; - String backFileName = backFilePath +datePath+"/"+json.getString("messageType")+"-"+json.getString("messageId")+".udi"; - if(!FileUtils.makeDirectory( filePath +datePath)) - IDCUtils.createDirectory(filePath +datePath+"/"); - if(!FileUtils.makeDirectory(backFilePath +datePath)) - IDCUtils.createDirectory(filePath +datePath+"/"); + String fileName =filePath +filePathSlash +datePath+"/"+json.getString("messageType")+"-"+json.getString("messageId")+".udi"; + String backFileName = backFilePath +backFileSlash +datePath+"/"+json.getString("messageType")+"-"+json.getString("messageId")+".udi"; + if(!FileUtils.makeDirectory( filePath +filePathSlash +datePath)) + IDCUtils.createDirectory(filePath +filePathSlash +datePath+"/"); + if(!FileUtils.makeDirectory(backFilePath +backFileSlash +datePath)) + IDCUtils.createDirectory(filePath +backFileSlash +datePath+"/"); FileUtils.SaveFileAs(content, fileName); FileUtils.SaveFileAs(content, backFileName); @@ -355,9 +356,10 @@ public class IdcServiceImpl implements IdcService { int n=0; try { for(MultipartFile file:files) { - saveFiles[n] = filePath +datePath+"/"+json.getString("messageId")+"/"+file.getOriginalFilename(); - writeFile(file.getBytes(), filePath +datePath+"/"+json.getString("messageId")+"/", file.getOriginalFilename()); - writeFile(file.getBytes(), backFilePath +datePath+"/"+json.getString("messageId")+"/", file.getOriginalFilename()); + String imageName = filePath +filePathSlash+"register/file/image2/"+file.getOriginalFilename(); + saveFiles[n] = imageName; + writeFile(file.getBytes(), filePath +filePathSlash+"register/file/image2/", file.getOriginalFilename()); + writeFile(file.getBytes(), backFilePath +backFileSlash+datePath+"register/file/image2/", file.getOriginalFilename()); n++; } } catch (IOException e) { @@ -495,7 +497,7 @@ public class IdcServiceImpl implements IdcService { orderNum++; String messageType = params.get("messageType").toString(); saveIdcLog(messageType,"",tableName +">"+where,0,total); - + String filePathSlash = filePath.substring(filePath.length() -1).equals("/") ? "" : "/"; if(total>0) { success = true; @@ -518,7 +520,7 @@ public class IdcServiceImpl implements IdcService { if(list!=null&&list.size()>0) { for(int m=0;m