From 26f4566facc60537c0c8d6e7f3b32a781b7e28e7 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Mon, 9 Oct 2023 10:26:10 +0800 Subject: [PATCH] =?UTF-8?q?BUGFIX:=E7=B3=BB=E7=BB=9F=E6=A8=A1=E7=89=B9?= =?UTF-8?q?=E9=AB=98=E5=AE=BD=E9=BB=98=E8=AE=A41050=20500;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ai/da/mapper/entity/SysFile.java | 3 -- .../java/com/ai/da/model/vo/SysFileVO.java | 4 -- .../java/com/ai/da/python/PythonService.java | 2 +- .../ai/da/service/impl/DesignServiceImpl.java | 38 +++++++++---------- .../da/service/impl/LibraryServiceImpl.java | 2 - .../resources/application-test.properties | 7 ++-- 6 files changed, 23 insertions(+), 33 deletions(-) diff --git a/src/main/java/com/ai/da/mapper/entity/SysFile.java b/src/main/java/com/ai/da/mapper/entity/SysFile.java index 0790bcfd..a718efcd 100644 --- a/src/main/java/com/ai/da/mapper/entity/SysFile.java +++ b/src/main/java/com/ai/da/mapper/entity/SysFile.java @@ -52,9 +52,6 @@ public class SysFile implements Serializable { */ private String md5; - private Integer high; - - private Integer width; /** * 路径 绝对路径 * diff --git a/src/main/java/com/ai/da/model/vo/SysFileVO.java b/src/main/java/com/ai/da/model/vo/SysFileVO.java index 7c1851c6..3f99d2c6 100644 --- a/src/main/java/com/ai/da/model/vo/SysFileVO.java +++ b/src/main/java/com/ai/da/model/vo/SysFileVO.java @@ -34,8 +34,4 @@ public class SysFileVO implements Serializable { */ private String md5; - private Integer high; - - private Integer width; - } diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 9ee180de..2121d787 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -1206,7 +1206,7 @@ public class PythonService { RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(content)); Request request = new Request.Builder() // .url(accessPythonIp+":11112/aifda/api/v1.0/attribute_retrieval") - .url(accessPythonIp+":11112/aifda/api/v1.0/attribute_retrieval") + .url(accessPythonIp+":9991/aifda/api/v1.0/attribute_retrieval") .method("POST", body) .addHeader("Authorization", "Basic YWlkbGFiOjEyMw==") .addHeader("Content-Type", "application/json") diff --git a/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java b/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java index 156a6fae..273df5ef 100644 --- a/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java @@ -110,26 +110,24 @@ public class DesignServiceImpl extends ServiceImpl impleme private void calculateLibraryAndSysFile(DesignCollectionDTO designDTO, ValidateElementVO elementVO, AuthPrincipalVo userInfo) { //查询用户 sketch library List libraryVos; -// if (CollectionUtil.isNotEmpty(designDTO.getSketchBoards())) { -// List sketchUrlList = elementVO.getSketchBoardElements() -// .stream() -// .map(CollectionElement::getUrl) -// .collect(Collectors.toList()); -// DesignAttributeRetrievalDTO designAttributeRetrievalDTO = -// pythonService.generateAttributeRetrieval(sketchUrlList, userInfo.getId()); -// if (CollectionUtils.isEmpty(designAttributeRetrievalDTO.getLibraryUrls())) { -// libraryVos = null; -// } else { -// libraryVos = libraryService.getByUrlList(designAttributeRetrievalDTO.getLibraryUrls(), userInfo.getId()); -// } -// List sysFileVOS = sysFileService.getByUrlList(designAttributeRetrievalDTO.getSysFileUrlS()); -// elementVO.setSysFileVo(sysFileVOS); -// } else { -// libraryVos = libraryService.selectByAccountIdAnd1TypeList(userInfo.getId(), -// Collections.singletonList(CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName())); -// } - libraryVos = libraryService.selectByAccountIdAnd1TypeList(userInfo.getId(), - Collections.singletonList(CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName())); + if (CollectionUtil.isNotEmpty(designDTO.getSketchBoards())) { + List sketchUrlList = elementVO.getSketchBoardElements() + .stream() + .map(CollectionElement::getUrl) + .collect(Collectors.toList()); + DesignAttributeRetrievalDTO designAttributeRetrievalDTO = + pythonService.generateAttributeRetrieval(sketchUrlList, userInfo.getId()); + if (CollectionUtils.isEmpty(designAttributeRetrievalDTO.getLibraryUrls())) { + libraryVos = null; + } else { + libraryVos = libraryService.getByUrlList(designAttributeRetrievalDTO.getLibraryUrls(), userInfo.getId()); + } + List sysFileVOS = sysFileService.getByUrlList(designAttributeRetrievalDTO.getSysFileUrlS()); + elementVO.setSysFileVo(sysFileVOS); + } else { + libraryVos = libraryService.selectByAccountIdAnd1TypeList(userInfo.getId(), + Collections.singletonList(CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName())); + } elementVO.setLibraryVos(libraryVos); //校验比列 validateRatio(designDTO, libraryVos); diff --git a/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java b/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java index 2c0ef9ef..626a3d68 100644 --- a/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java @@ -278,8 +278,6 @@ public class LibraryServiceImpl extends ServiceImpl impl sysFile.setUrl(filePath); sysFile.setMd5(uploadDTO.getMd5()); sysFile.setCreateDate(new Date()); - sysFile.setHigh(uploadDTO.getHigh()); - sysFile.setWidth(uploadDTO.getWidth()); sysFileMapper.insert(sysFile); Library library = new Library(); library.setId(sysFile.getId()); diff --git a/src/main/resources/application-test.properties b/src/main/resources/application-test.properties index 392b09ec..d23d5046 100644 --- a/src/main/resources/application-test.properties +++ b/src/main/resources/application-test.properties @@ -1,4 +1,4 @@ -server.port=5567 +server.port=10086 #datasource spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver @@ -42,8 +42,9 @@ spring.servlet.multipart.max-file-size = 5MB spring.servlet.multipart.max-request-size= 5MB #访问python服务的ip(对应环境) -#access.python.ip=http://18.167.251.121 -access.python.ip=http://43.198.80.117 +#access.python.ip=http://43.198.80.117 +access.python.ip=http://18.167.251.121 +#access.python.ip=http://18.167.251.121:9991/ # minIO服务配置之信息 minio.endpoint=http://18.167.251.121:9000