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 04611c1..e8ef65c 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 @@ -297,8 +297,8 @@ public class IdcServiceImpl implements IdcService { 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"; - FileUtils.makeDirectory(fileName); - FileUtils.makeDirectory(backFileName); + FileUtils.makeDirectory( filePath +datePath+"/"); + FileUtils.makeDirectory(backFilePath +datePath+"/"); FileUtils.SaveFileAs(content, fileName); FileUtils.SaveFileAs(content, backFileName); @@ -333,9 +333,10 @@ public class IdcServiceImpl implements IdcService { String host = getNextHost(); String result = relay(request.getHeader("reqNo"),content,saveFiles,host); if(IDCUtils.isJson(result)) { - JSONObject object = JSON.parseObject(result); - if(object.getInteger("code")!=20000) - return ResultVOUtils.error(9000, "转发失败"); + BaseResponse object = JSON.parseObject(result,BaseResponse.class); + return object; + } else { + return ResultVOUtils.error(9000, "转发失败"); } } @@ -539,8 +540,8 @@ public class IdcServiceImpl implements IdcService { String datePath = DateUtil.formatDate(new Date(),"yyyy-MM-dd"); String fileName = filePath +datePath+"/"+json.get("messageType")+"-"+json.get("messageId")+".udi"; String backFileName = backFilePath +datePath+"/"+json.get("messageType")+"-"+json.get("messageId")+".udi"; - FileUtils.makeDirectory(fileName); - FileUtils.makeDirectory(backFileName); + FileUtils.makeDirectory(filePath +datePath+"/"); + FileUtils.makeDirectory(backFilePath +datePath+"/"); FileUtils.SaveFileAs(content, fileName); FileUtils.SaveFileAs(content, backFileName); @@ -760,7 +761,7 @@ public class IdcServiceImpl implements IdcService { /*是否需要转发*/ private boolean isRelay() { String relayHost = getNextHost(); - return !StringUtils.isEmpty(relayHost); + return StringUtils.isEmpty(relayHost) ? false : true; }