From 9bd695a24d41da873dd252986a9c05e707d35512 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Wed, 26 Jun 2024 10:47:56 +0800 Subject: [PATCH 01/11] TASK:aida; --- .../com/ai/da/common/RabbitMQ/GenerateConsumer.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java index 88d5ae19..791dd025 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java @@ -316,11 +316,11 @@ public class GenerateConsumer { // processGenerateResult(msg, channel); // } // -// @RabbitListener(queues = MQConfig.TO_PRODUCT_IMAGE_RESULT_QUEUE) -// @RabbitHandler -// public void getToProductImageResult(Message msg, Channel channel) { -// processToProductImageResult(msg, channel); -// } + @RabbitListener(queues = MQConfig.TO_PRODUCT_IMAGE_RESULT_QUEUE) + @RabbitHandler + public void getToProductImageResult(Message msg, Channel channel) { + processToProductImageResult(msg, channel); + } @RabbitListener(queues = MQConfig.RELIGHT_RESULT_QUEUE) @RabbitHandler From 58a78a5366067cc8ea4029fd367773bdf968c921 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Wed, 26 Jun 2024 13:24:27 +0800 Subject: [PATCH 02/11] TASK:aida; --- .../da/common/RabbitMQ/GenerateConsumer.java | 120 +++++++++--------- .../com/ai/da/common/RabbitMQ/MQConfig.java | 4 +- .../com/ai/da/common/RabbitMQ/SRConsumer.java | 24 ++-- 3 files changed, 74 insertions(+), 74 deletions(-) diff --git a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java index 791dd025..7ba3f36b 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java @@ -256,66 +256,66 @@ public class GenerateConsumer { log.info("============ProcessRelightResult End listening=========="); } -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer1(Message msg, Channel channel) { -// generate(msg, channel, "consumer 1"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer2(Message msg, Channel channel) { -// generate(msg, channel, "consumer 2"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer3(Message msg, Channel channel) { -// generate(msg, channel, "consumer 3"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer4(Message msg, Channel channel) { -// generate(msg, channel, "consumer 4"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer5(Message msg, Channel channel) { -// generate(msg, channel, "consumer 5"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer6(Message msg, Channel channel) { -// generate(msg, channel, "consumer 6"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer7(Message msg, Channel channel) { -// generate(msg, channel, "consumer 7"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer8(Message msg, Channel channel) { -// generate(msg, channel, "consumer 8"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer9(Message msg, Channel channel) { -// generate(msg, channel, "consumer 9"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_RESULT_QUEUE) -// @RabbitHandler -// public void getGenerateResult(Message msg, Channel channel) { -// processGenerateResult(msg, channel); -// } -// + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer1(Message msg, Channel channel) { + generate(msg, channel, "consumer 1"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer2(Message msg, Channel channel) { + generate(msg, channel, "consumer 2"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer3(Message msg, Channel channel) { + generate(msg, channel, "consumer 3"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer4(Message msg, Channel channel) { + generate(msg, channel, "consumer 4"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer5(Message msg, Channel channel) { + generate(msg, channel, "consumer 5"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer6(Message msg, Channel channel) { + generate(msg, channel, "consumer 6"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer7(Message msg, Channel channel) { + generate(msg, channel, "consumer 7"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer8(Message msg, Channel channel) { + generate(msg, channel, "consumer 8"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer9(Message msg, Channel channel) { + generate(msg, channel, "consumer 9"); + } + + @RabbitListener(queues = MQConfig.GENERATE_RESULT_QUEUE) + @RabbitHandler + public void getGenerateResult(Message msg, Channel channel) { + processGenerateResult(msg, channel); + } + @RabbitListener(queues = MQConfig.TO_PRODUCT_IMAGE_RESULT_QUEUE) @RabbitHandler public void getToProductImageResult(Message msg, Channel channel) { diff --git a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java index b44bea8c..7f9e4b18 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java @@ -26,9 +26,9 @@ public class MQConfig { // public static final String GENERATE_RESULT_QUEUE = "GenerateImage-local"; public static final String GENERATE_RESULT_QUEUE = "GenerateImage-dev"; - public static final String TO_PRODUCT_IMAGE_RESULT_QUEUE = "ToProductImage-local"; + public static final String TO_PRODUCT_IMAGE_RESULT_QUEUE = "ToProductImage-dev"; - public static final String RELIGHT_RESULT_QUEUE = "Relight-local"; + public static final String RELIGHT_RESULT_QUEUE = "Relight-dev"; public MQConfig() { } diff --git a/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java b/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java index b8ba32f2..6ad261bd 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java @@ -218,17 +218,17 @@ public class SRConsumer { taskListService.updateTaskStatusOrOutputRedis(uniqueId, "fail", null); } -// @RabbitListener(queues = MQConfig.SR_QUEUE) -// @RabbitHandler -// public void SRConsumer1(Message msg, Channel channel) { -// superResolution(msg, channel, "consumer 1"); -// } -// -// -// @RabbitListener(queues = MQConfig.SR_RESULT_QUEUE) -// @RabbitHandler -// public void SRResultConsumer1(Message msg, Channel channel) { -// getSRResult(msg, channel, "consumer 1"); -// } + @RabbitListener(queues = MQConfig.SR_QUEUE) + @RabbitHandler + public void SRConsumer1(Message msg, Channel channel) { + superResolution(msg, channel, "consumer 1"); + } + + + @RabbitListener(queues = MQConfig.SR_RESULT_QUEUE) + @RabbitHandler + public void SRResultConsumer1(Message msg, Channel channel) { + getSRResult(msg, channel, "consumer 1"); + } } From 9b438c78a38a5248210a99c71e5227b0376c2037 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Thu, 27 Jun 2024 15:33:26 +0800 Subject: [PATCH 03/11] TASK:aida; --- .../ai/da/common/config/MyTaskScheduler.java | 113 +++++++++++++++--- .../com/ai/da/common/utils/ExcelReader.java | 33 +++++ .../com/ai/da/common/utils/MinioUtil.java | 16 +++ .../ai/da/controller/PortfolioController.java | 6 + .../controller/SavedCollectionController.java | 2 +- .../secondary/AttributeRetrievalMapper.java | 8 +- .../java/com/ai/da/model/vo/SysFileVO.java | 2 + .../da/model/vo/ToProductImageResultVO.java | 9 ++ .../com/ai/da/model/vo/ValidateElementVO.java | 2 + .../java/com/ai/da/python/PythonService.java | 84 +++++++++---- .../com/ai/da/service/PortfolioService.java | 2 + .../ai/da/service/UserLikeGroupService.java | 2 +- .../impl/CollectionElementServiceImpl.java | 4 + .../ai/da/service/impl/DesignServiceImpl.java | 2 +- .../da/service/impl/LibraryServiceImpl.java | 1 + .../da/service/impl/PortfolioServiceImpl.java | 30 ++++- .../impl/UserLikeGroupServiceImpl.java | 31 +++-- src/main/resources/application-dev.properties | 2 +- .../secondary/AttributeRetrievalMapper.xml | 23 ++++ 19 files changed, 312 insertions(+), 60 deletions(-) create mode 100644 src/main/java/com/ai/da/common/utils/ExcelReader.java create mode 100644 src/main/java/com/ai/da/model/vo/ToProductImageResultVO.java diff --git a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java index 6fb19b5a..3473f597 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -1,5 +1,6 @@ package com.ai.da.common.config; +import com.ai.da.common.utils.ExcelReader; import com.ai.da.common.utils.MinioUtil; import com.ai.da.common.utils.SendEmailUtil; import com.ai.da.mapper.primary.*; @@ -26,6 +27,9 @@ import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; @Component @@ -34,6 +38,7 @@ public class MyTaskScheduler { @PostConstruct public void test() { // clearMinio(); +// addSystemFileStyle(); } @Resource @@ -214,30 +219,104 @@ public class MyTaskScheduler { private AttributeRetrievalMapper attributeRetrievalMapper; public void addSystemFileStyle() { - String directoryPath = "C:\\Users\\10233\\Downloads\\blouse done\\blouse done\\废土风"; - List fileNames = getFileNames(directoryPath); - for (String fileName : fileNames) { - String tableName = "female_top"; - String style = "feitufeng"; - Long idByFileName = attributeRetrievalMapper.getIdByFileName(fileName, tableName); - attributeRetrievalMapper.updateStyleById(idByFileName, style, tableName); + ExecutorService executorService = Executors.newFixedThreadPool(5); + + try { + String[] filePaths = { + "C:\\Users\\10233\\Documents\\WeChat Files\\wxid_h7l9im0r8ql922\\FileStorage\\File\\2024-06\\style\\Blouse style output updated25.6.2024.xlsx", + "C:\\Users\\10233\\Documents\\WeChat Files\\wxid_h7l9im0r8ql922\\FileStorage\\File\\2024-06\\style\\Dress style output updated25.6.2024.xlsx", + "C:\\Users\\10233\\Documents\\WeChat Files\\wxid_h7l9im0r8ql922\\FileStorage\\File\\2024-06\\style\\Outerwear style output.xlsx", + "C:\\Users\\10233\\Documents\\WeChat Files\\wxid_h7l9im0r8ql922\\FileStorage\\File\\2024-06\\style\\Skirt style output .xlsx", + "C:\\Users\\10233\\Documents\\WeChat Files\\wxid_h7l9im0r8ql922\\FileStorage\\File\\2024-06\\style\\Trousers style output.xlsx" + }; + + for (String filePath : filePaths) { + executorService.submit(() -> processExcelFile(filePath)); + } + } finally { + executorService.shutdown(); + try { + if (!executorService.awaitTermination(60, TimeUnit.MINUTES)) { + executorService.shutdownNow(); + } + } catch (InterruptedException e) { + executorService.shutdownNow(); + } } } - public static List getFileNames(String directoryPath) { - List fileNames = new ArrayList<>(); - Path path = Paths.get(directoryPath); + private void processExcelFile(String filePath) { + System.out.println("线程开始"); + try { + List> excelData = ExcelReader.readExcel(filePath); + String tableName = getTableNameFromFilePath(filePath); + String prefix = getPrefixFromFilePath(filePath); - try (DirectoryStream stream = Files.newDirectoryStream(path)) { - for (Path entry : stream) { - if (Files.isRegularFile(entry)) { - fileNames.add(entry.getFileName().toString()); + for (List columnData : excelData) { + String style = columnData.get(0); + for (int i = 1; i < columnData.size(); i++) { + String fileName = columnData.get(i); + if (StringUtils.isBlank(fileName)) { + continue; + } + if ("X".equals(style)) { + attributeRetrievalMapper.updateStyleByFileName("X", prefix + fileName, tableName); + System.out.println(fileName); + } else { + attributeRetrievalMapper.updateStyleByFileName(style, prefix + fileName, tableName); + System.out.println(fileName); + } } } } catch (IOException e) { - System.err.println("Error reading directory: " + e.getMessage()); + e.printStackTrace(); } - - return fileNames; } + + private String getTableNameFromFilePath(String filePath) { + if (filePath.contains("Blouse")) { + return "female_top"; + } else if (filePath.contains("Dress")) { + return "female_dress"; + } else if (filePath.contains("Outerwear")) { + return "female_outwear"; + } else if (filePath.contains("Skirt")) { + return "female_skirt"; + } else if (filePath.contains("Trousers")) { + return "female_pants"; + } + return ""; + } + + private String getPrefixFromFilePath(String filePath) { + if (filePath.contains("Blouse")) { + return "blouse/"; + } else if (filePath.contains("Dress")) { + return "dress/"; + } else if (filePath.contains("Outerwear")) { + return "outwear/"; + } else if (filePath.contains("Skirt")) { + return "skirt/"; + } else if (filePath.contains("Trousers")) { + return "trousers/"; + } + return ""; + } + +// public static List getFileNames(String directoryPath) { +// List fileNames = new ArrayList<>(); +// Path path = Paths.get(directoryPath); +// +// try (DirectoryStream stream = Files.newDirectoryStream(path)) { +// for (Path entry : stream) { +// if (Files.isRegularFile(entry)) { +// fileNames.add(entry.getFileName().toString()); +// } +// } +// } catch (IOException e) { +// System.err.println("Error reading directory: " + e.getMessage()); +// } +// +// return fileNames; +// } } diff --git a/src/main/java/com/ai/da/common/utils/ExcelReader.java b/src/main/java/com/ai/da/common/utils/ExcelReader.java new file mode 100644 index 00000000..d053b1e9 --- /dev/null +++ b/src/main/java/com/ai/da/common/utils/ExcelReader.java @@ -0,0 +1,33 @@ +package com.ai.da.common.utils; + +import lombok.Data; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +import java.io.FileInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +@Data +public class ExcelReader { + public static List> readExcel(String filePath) throws IOException { + List> data = new ArrayList<>(); + try (FileInputStream fis = new FileInputStream(filePath); + Workbook workbook = new XSSFWorkbook(fis)) { + Sheet sheet = workbook.getSheetAt(0); + int numberOfColumns = sheet.getRow(0).getLastCellNum(); + + for (int i = 0; i < numberOfColumns; i++) { + List columnData = new ArrayList<>(); + for (Row row : sheet) { + columnData.add(row.getCell(i).getStringCellValue()); + } + data.add(columnData); + } + } + return data; + } +} diff --git a/src/main/java/com/ai/da/common/utils/MinioUtil.java b/src/main/java/com/ai/da/common/utils/MinioUtil.java index 300d68d3..6b6dc525 100644 --- a/src/main/java/com/ai/da/common/utils/MinioUtil.java +++ b/src/main/java/com/ai/da/common/utils/MinioUtil.java @@ -405,6 +405,22 @@ public class MinioUtil { } } + public String getPresignedUrl(String path, int expiry, boolean resetCache) { + if (resetCache || LocalCacheUtils.getPresignedUrlCache(path) == null) { + if (!path.contains("/")) { + throw new BusinessException("The path is error!"); + } + int index = path.indexOf("/"); + String bucketName = path.substring(0, index); + String fileName = path.substring(index + 1); + String presignedUrl = getPresignedUrl(bucketName, fileName, expiry); + LocalCacheUtils.setPresignedUrlCache(path, presignedUrl); + return presignedUrl; + } else { + return LocalCacheUtils.getPresignedUrlCache(path); + } + } + /** * 将桶名、文件名从url中分离出来 * diff --git a/src/main/java/com/ai/da/controller/PortfolioController.java b/src/main/java/com/ai/da/controller/PortfolioController.java index d2c2fcfd..09e8bd39 100644 --- a/src/main/java/com/ai/da/controller/PortfolioController.java +++ b/src/main/java/com/ai/da/controller/PortfolioController.java @@ -32,6 +32,12 @@ public class PortfolioController { return Response.success(portfolioService.publish(canvas, data)); } + @ApiOperation(value = "删除作品集") + @GetMapping("/delete") + public Response delete(@RequestParam("id") Long id) { + return Response.success(portfolioService.delete(id)); + } + @CrossOrigin @ApiOperation(value = "作品集page") @PostMapping("/page") diff --git a/src/main/java/com/ai/da/controller/SavedCollectionController.java b/src/main/java/com/ai/da/controller/SavedCollectionController.java index d832bdb9..3942b5aa 100644 --- a/src/main/java/com/ai/da/controller/SavedCollectionController.java +++ b/src/main/java/com/ai/da/controller/SavedCollectionController.java @@ -209,7 +209,7 @@ public class SavedCollectionController { @ApiOperation("productImageLikeList") @PostMapping("/productImageLikeList") - public Response> productImageLikeList(@Valid @RequestBody ToProductImageDTO toProductImageDTO) { + public Response> productImageLikeList(@Valid @RequestBody ToProductImageDTO toProductImageDTO) { return Response.success(userLikeGroupService.productImageLikeList(toProductImageDTO)); } diff --git a/src/main/java/com/ai/da/mapper/secondary/AttributeRetrievalMapper.java b/src/main/java/com/ai/da/mapper/secondary/AttributeRetrievalMapper.java index 6b74dc9e..1c3be31b 100644 --- a/src/main/java/com/ai/da/mapper/secondary/AttributeRetrievalMapper.java +++ b/src/main/java/com/ai/da/mapper/secondary/AttributeRetrievalMapper.java @@ -17,13 +17,15 @@ import java.util.List; public interface AttributeRetrievalMapper { - List getSystemSketchPool(@Param("attributeRetrievalAttrDict") AttributeRetrieval attributeRetrievalAttrDict, @Param("tableName") String tableName, @Param("poolNum") int poolNum); + List getSystemSketchPool(@Param("attributeRetrievalAttrDict") AttributeRetrieval attributeRetrievalAttrDict, @Param("tableName") String tableName, @Param("poolNum") int poolNum, @Param("style") String style); - AttributeRetrieval getSystemRandom(String tableName); + AttributeRetrieval getSystemRandom(String tableName, String style); - List getSystemSketchPoolBySameCategory(AttributeRetrieval attributeRetrievalAttrDict, String tableName); + List getSystemSketchPoolBySameCategory(AttributeRetrieval attributeRetrievalAttrDict, String tableName, String style); Long getIdByFileName(String fileName, String tableName); void updateStyleById(Long idByFileName, String style, String tableName); + + void updateStyleByFileName(String style, String fileName, String tableName); } 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 339d2902..dd03260d 100644 --- a/src/main/java/com/ai/da/model/vo/SysFileVO.java +++ b/src/main/java/com/ai/da/model/vo/SysFileVO.java @@ -33,4 +33,6 @@ public class SysFileVO implements Serializable { */ private String md5; + private String level3Type; + } diff --git a/src/main/java/com/ai/da/model/vo/ToProductImageResultVO.java b/src/main/java/com/ai/da/model/vo/ToProductImageResultVO.java new file mode 100644 index 00000000..c0c495c0 --- /dev/null +++ b/src/main/java/com/ai/da/model/vo/ToProductImageResultVO.java @@ -0,0 +1,9 @@ +package com.ai.da.model.vo; + +import com.ai.da.mapper.primary.entity.ToProductImageResult; +import lombok.Data; + +@Data +public class ToProductImageResultVO extends ToProductImageResult { + private String sourceUrl; +} diff --git a/src/main/java/com/ai/da/model/vo/ValidateElementVO.java b/src/main/java/com/ai/da/model/vo/ValidateElementVO.java index 563c4ab1..f2cb87a1 100644 --- a/src/main/java/com/ai/da/model/vo/ValidateElementVO.java +++ b/src/main/java/com/ai/da/model/vo/ValidateElementVO.java @@ -45,4 +45,6 @@ public class ValidateElementVO { //透传sysFileVo用(attribute_retrieval 接口限定sysFile范围) List sysFileVo; private String modelSex; + + private String style; } diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index a911fe84..11210996 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -602,7 +602,7 @@ public class PythonService { } else if (systemScale.compareTo(BigDecimal.ONE) != 0) { BigDecimal collectNoPinSize = BigDecimal.valueOf(collectionNoPinSize); poolNum = collectNoPinSize.divide(systemScale, 0, RoundingMode.DOWN).intValue(); - List list = getSystemSketchPool(attributeRecognition, styleCategory, elementVO.getModelSex(), poolNum); + List list = getSystemSketchPool(attributeRecognition, styleCategory, elementVO.getModelSex(), poolNum, elementVO.getStyle()); collectionElements.addAll(list); int randomNum = RandomsUtil.randomSysFile(collectionElements.size()); if (randomNum < collectionNoPinSize) { @@ -612,7 +612,7 @@ public class PythonService { } } } - List list = getSystemSketchPool(attributeRecognition, styleCategory, elementVO.getModelSex(), poolNum); + List list = getSystemSketchPool(attributeRecognition, styleCategory, elementVO.getModelSex(), poolNum, elementVO.getStyle()); int randomNum = RandomsUtil.randomSysFile(list.size()); return coverSketchToDesignPythonItem(null, list.get(randomNum), elementVO); } @@ -622,7 +622,7 @@ public class PythonService { } private DesignPythonItem processAttributeRecognitionBySameCategory(JSONObject attributeRecognition, ValidateElementVO elementVO, String styleCategory) { - List list = getSystemSketchPoolBySameCategory(attributeRecognition, styleCategory, elementVO.getModelSex()); + List list = getSystemSketchPoolBySameCategory(attributeRecognition, styleCategory, elementVO.getModelSex(), elementVO.getStyle()); int randomNum = RandomsUtil.randomSysFile(list.size()); return coverSketchToDesignPythonItem(null, list.get(randomNum), elementVO); } @@ -630,7 +630,7 @@ public class PythonService { @Resource private AttributeRetrievalMapper attributeRetrievalMapper; - private List getSystemSketchPool(JSONObject attributeRecognition, String styleCategory, String modelSex, int poolNum) { + private List getSystemSketchPool(JSONObject attributeRecognition, String styleCategory, String modelSex, int poolNum, String style) { /** * female trousers->female_pants * female blouse->female_top @@ -644,19 +644,19 @@ public class PythonService { AttributeRetrieval attributeRetrievalAttrDict = toAttrDict(attrDictJSON); String tableName; tableName = getTableName(modelSex, styleCategory); - List attributeRetrievalList = attributeRetrievalMapper.getSystemSketchPool(attributeRetrievalAttrDict, tableName, poolNum); + List attributeRetrievalList = attributeRetrievalMapper.getSystemSketchPool(attributeRetrievalAttrDict, tableName, poolNum, style); if (CollectionUtil.isEmpty(attributeRetrievalList) || attributeRetrievalList.size() < poolNum) { attributeRetrievalAttrDict.setDesign(null); - attributeRetrievalList = attributeRetrievalMapper.getSystemSketchPool(attributeRetrievalAttrDict, tableName, poolNum); + attributeRetrievalList = attributeRetrievalMapper.getSystemSketchPool(attributeRetrievalAttrDict, tableName, poolNum, style); } if (CollectionUtil.isEmpty(attributeRetrievalList) || attributeRetrievalList.size() < poolNum) { attributeRetrievalAttrDict.setSilhouette(null); - attributeRetrievalList = attributeRetrievalMapper.getSystemSketchPool(attributeRetrievalAttrDict, tableName, poolNum); + attributeRetrievalList = attributeRetrievalMapper.getSystemSketchPool(attributeRetrievalAttrDict, tableName, poolNum, style); } return toColoectionElementList(attributeRetrievalList, styleCategory, modelSex); } - private List getSystemSketchPoolBySameCategory(JSONObject attributeRecognition, String styleCategory, String modelSex) { + private List getSystemSketchPoolBySameCategory(JSONObject attributeRecognition, String styleCategory, String modelSex, String style) { /** * female trousers->female_pants * female blouse->female_top @@ -712,7 +712,7 @@ public class PythonService { } } - List attributeRetrievalList = attributeRetrievalMapper.getSystemSketchPoolBySameCategory(attributeRetrievalAttrDict, tableName); + List attributeRetrievalList = attributeRetrievalMapper.getSystemSketchPoolBySameCategory(attributeRetrievalAttrDict, tableName, style); if (CollectionUtil.isEmpty(attributeRetrievalList)) { System.out.println(attributeRetrievalAttrDict); System.out.println(tableName); @@ -935,7 +935,7 @@ public class PythonService { Integer randomNum = RandomsUtil.randomSysFile(dressings.size()); String category = dressings.get(randomNum).getStyleCategory(); String tableName = getTableName(validateElementVO.getModelSex(), category); - AttributeRetrieval attributeRetrieval = attributeRetrievalMapper.getSystemRandom(tableName); + AttributeRetrieval attributeRetrieval = attributeRetrievalMapper.getSystemRandom(tableName, validateElementVO.getStyle()); CollectionElement collectionElement = toCollectionElement(attributeRetrieval, category, validateElementVO.getModelSex()); return coverSketchToDesignPythonItem(null, collectionElement, validateElementVO); } @@ -975,7 +975,7 @@ public class PythonService { Integer randomNum = RandomsUtil.randomSysFile(dressings.size()); String category = dressings.get(randomNum).getStyleCategory(); String tableName = getTableName(validateElementVO.getModelSex(), category); - AttributeRetrieval attributeRetrieval = attributeRetrievalMapper.getSystemRandom(tableName); + AttributeRetrieval attributeRetrieval = attributeRetrievalMapper.getSystemRandom(tableName, validateElementVO.getStyle()); CollectionElement collectionElement = toCollectionElement(attributeRetrieval, category, validateElementVO.getModelSex()); return coverSketchToDesignPythonItem(null, collectionElement, validateElementVO); } @@ -2801,23 +2801,23 @@ public class PythonService { private List coverToModelsDotPythonItem(ModelsDotDTO modelsDotDTO) { List response = Lists.newArrayList(); if (modelsDotDTO.getTemplateUrl().contains("female")) { - DesignPythonItem dress = new DesignPythonItem(); - dress.setType(SysFileLevel2TypeEnum.DRESS.getRealName()); - dress.setColor("none"); - dress.setIcon("none"); +// DesignPythonItem dress = new DesignPythonItem(); +// dress.setType(SysFileLevel2TypeEnum.DRESS.getRealName()); +// dress.setColor("none"); +// dress.setIcon("none"); DesignPythonItemPrint designPythonItemPrint = new DesignPythonItemPrint(); designPythonItemPrint.setIfSingle(false); designPythonItemPrint.setPrint_path_list(new ArrayList<>()); - dress.setPrint(designPythonItemPrint); - dress.setPath("aida-sys-image/images/female/blouse/blouse_p5_817.jpg"); - response.add(dress); +// dress.setPrint(designPythonItemPrint); +// dress.setPath("aida-sys-image/images/female/blouse/blouse_p5_817.jpg"); +// response.add(dress); DesignPythonItem skirt = new DesignPythonItem(); - skirt.setType(SysFileLevel2TypeEnum.TROUSERS.getRealName()); + skirt.setType(SysFileLevel2TypeEnum.DRESS.getRealName()); skirt.setColor("none"); skirt.setIcon("none"); skirt.setPrint(designPythonItemPrint); - skirt.setPath("aida-sys-image/images/female/trousers/trousers_974.jpg"); + skirt.setPath("aida-sys-image/images/female/dress/0628002038.jpeg"); response.add(skirt); } else { DesignPythonItem top = new DesignPythonItem(); @@ -2839,7 +2839,7 @@ public class PythonService { designPythonItemPrint1.setIfSingle(false); designPythonItemPrint1.setPrint_path_list(new ArrayList<>()); bottom.setPrint(designPythonItemPrint1); - bottom.setPath("aida-sys-image/images/male/bottoms/mens_test_10007.png"); + bottom.setPath("aida-sys-image/images/male/bottoms/mens_test_12.png"); response.add(bottom); } @@ -3348,4 +3348,46 @@ public class PythonService { //生成失败 throw new BusinessException("toProductImage.interface.exception"); } + + public Boolean relight(String url, String taskId, String prompt) { + // todo 限流校验 +// AccessLimitUtils.validate("design",5); + OkHttpClient client = new OkHttpClient().newBuilder() + .connectTimeout(30, TimeUnit.SECONDS) + .pingInterval(5, TimeUnit.SECONDS)//websocket轮训间隔(单位:秒) + .readTimeout(60, TimeUnit.SECONDS)//读取超时(单位:秒) + .writeTimeout(60, TimeUnit.SECONDS)//写入超时(单位:秒) + .build(); + MediaType mediaType = MediaType.parse("application/json"); + //关闭FastJson的引用检测 防止出现$ref 现象 + Map map = new HashMap<>(); + map.put("tasks_id", taskId); + map.put("image_url", url); + map.put("prompt", prompt); + log.info("relightImage请求python 参数:####{}", map); + String param = JSON.toJSONString(map, SerializerFeature.WriteNullStringAsEmpty); + RequestBody body = RequestBody.create(mediaType, param); + Request request = new Request.Builder() +// .url(accessPythonIp + ":" + accessPythonPort + "/api/generate_product_image") +// .url(accessPythonIp + ":9996/api/generate_product_image") + .url(accessPythonIp + ":9994/api/generate_relight_image") + .method("POST", body) + .addHeader("Authorization", "Basic YWlkbGFiOjEyMw==") + .addHeader("Content-Type", "application/json") + .build(); + Response response; + String responseBody; + try { + response = client.newCall(request).execute(); + } catch (IOException ioException) { + log.error("PythonService##relightImage异常###{}", ExceptionUtil.getThrowableList(ioException)); + throw new BusinessException("relightImage.interface.exception"); + } + if (response.isSuccessful()) { + return Boolean.TRUE; + } + log.error("PythonService##relightImage异常response###{}", response); + //生成失败 + throw new BusinessException("relightImage.interface.exception"); + } } diff --git a/src/main/java/com/ai/da/service/PortfolioService.java b/src/main/java/com/ai/da/service/PortfolioService.java index bd7fcbb4..86191a69 100644 --- a/src/main/java/com/ai/da/service/PortfolioService.java +++ b/src/main/java/com/ai/da/service/PortfolioService.java @@ -37,4 +37,6 @@ public interface PortfolioService extends IService { Long viewsGet(Long id); Boolean commentDelete(CommentDTO commentDTO); + + Boolean delete(Long id); } diff --git a/src/main/java/com/ai/da/service/UserLikeGroupService.java b/src/main/java/com/ai/da/service/UserLikeGroupService.java index 9ebc1527..d50214b0 100644 --- a/src/main/java/com/ai/da/service/UserLikeGroupService.java +++ b/src/main/java/com/ai/da/service/UserLikeGroupService.java @@ -53,7 +53,7 @@ public interface UserLikeGroupService extends IService { CanvasElementUpload canvasElementUpload(MultipartFile file); - List productImageLikeList(ToProductImageDTO toProductImageDTO); + List productImageLikeList(ToProductImageDTO toProductImageDTO); Boolean productImageUnLike(ProductImageLikeDTO productImageLikeDTO); diff --git a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java index 8bced01d..3fd813e2 100644 --- a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java @@ -13,6 +13,7 @@ import com.ai.da.mapper.primary.entity.*; import com.ai.da.model.dto.*; import com.ai.da.model.enums.ModelType; import com.ai.da.model.enums.Sex; +import com.ai.da.model.enums.StyleEnum; import com.ai.da.model.vo.*; import com.ai.da.python.PythonService; import com.ai.da.python.vo.DesignPythonItem; @@ -578,6 +579,9 @@ public class CollectionElementServiceImpl extends ServiceImpl impleme .collect(Collectors.toList()); response.setClothes(CopyUtil.copyList(filterDetail, DesignItemClothesDetailVO.class, (o, d) -> { d.setId(o.getId()); - d.setPath(minioUtil.getPresignedUrl(o.getPath(), 24 * 60)); + d.setPath(minioUtil.getPresignedUrl(o.getPath(), 24 * 60, true)); d.setMinIOPath(o.getPath()); d.setLevel1Type(converTypeToLevel1(o.getType())); d.setGradient(JSONObject.parseObject(o.getGradientString(), Gradient.class)); 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 a6b0b3c8..54345eec 100644 --- a/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java @@ -281,6 +281,7 @@ public class LibraryServiceImpl extends ServiceImpl impl path = "models/" + libraryUploadDTO.getModelSex().toLowerCase(); String filePath = minioUtil.upload(bucketName, path, libraryUploadDTO.getFile()); String newFilePath = processMannequins(filePath); +// String newFilePath = filePath; Library library = resolveData(libraryUploadDTO, userInfo, newFilePath); LibraryUpdateVo libraryUpdateVo = CopyUtil.copyObject(library, LibraryUpdateVo.class); libraryUpdateVo.setMinIOPath(libraryUpdateVo.getUrl()); diff --git a/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java b/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java index 8e29615c..3e0a3554 100644 --- a/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java @@ -431,11 +431,15 @@ public class PortfolioServiceImpl extends ServiceImpl getChildCommentVOList(Long id) { QueryWrapper qw = new QueryWrapper<>(); qw.lambda().eq(Comment::getParentLevel1Id, id); diff --git a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java index 0e645959..ffa09292 100644 --- a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java @@ -346,8 +346,8 @@ public class UserLikeGroupServiceImpl extends ServiceImpl productImageLikeList(ToProductImageDTO toProductImageDTO) { + public List productImageLikeList(ToProductImageDTO toProductImageDTO) { QueryWrapper qw = new QueryWrapper<>(); qw.lambda().eq(ToProductImageResult::getIsLike, 1); qw.lambda().eq(ToProductImageResult::getUserLikeGroupId, toProductImageDTO.getUserLikeGroupId()); @@ -409,7 +409,20 @@ public class UserLikeGroupServiceImpl extends ServiceImpl toProductImageResultVOS = CopyUtil.copyList(toProductImageResults, ToProductImageResultVO.class); + for (ToProductImageResultVO toProductImageResultVO : toProductImageResultVOS) { + if (toProductImageResultVO.getElementType().equals("ProductElement")) { + ToProductElement toProductElement = toProductElementMapper.selectById(toProductImageResultVO.getElementId()); + toProductImageResultVO.setSourceUrl(minioUtil.getPresignedUrl(toProductElement.getUrl(), 24 * 60)); + }else if ((toProductImageResultVO.getElementType().equals("DesignOutfit"))) { + TDesignPythonOutfit tDesignPythonOutfit = designPythonOutfitMapper.selectById(toProductImageResultVO.getElementId()); + toProductImageResultVO.setSourceUrl(minioUtil.getPresignedUrl(tDesignPythonOutfit.getDesignUrl(), 24 * 60)); + }else { + ToProductImageResult toProductImageResult1 = toProductImageResultMapper.selectById(toProductImageResultVO.getElementId()); + toProductImageResultVO.setSourceUrl(minioUtil.getPresignedUrl(toProductImageResult1.getUrl(), 24 * 60)); + } + } + return toProductImageResultVOS; } @Override @@ -443,15 +456,15 @@ public class UserLikeGroupServiceImpl extends ServiceImpl results = new ArrayList<>(); Set collect = new HashSet<>(); taskIdList.forEach(taskId -> { - String key = toProductImageResultKey + ":" + taskId; + String key = relightResultKey + ":" + taskId; MagicToolResultVO magicToolResultVO = new Gson().fromJson(redisUtil.getFromString(key), MagicToolResultVO.class); if (!Objects.isNull(magicToolResultVO) && !StringUtil.isNullOrEmpty(magicToolResultVO.getUrl())) { String url = magicToolResultVO.getUrl(); diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 21b5e945..3f14f686 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -6,7 +6,7 @@ spring.datasource.primary.username=aida_con spring.datasource.primary.password=123456 spring.datasource.secondary.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.secondary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/attribute_retrieval_new?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true +spring.datasource.secondary.jdbcUrl=jdbc:mysql://18.167.251.121:33008/attribute_retrieval_new_style?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true spring.datasource.secondary.username=aida_con spring.datasource.secondary.password=123456 diff --git a/src/main/resources/mapper/secondary/AttributeRetrievalMapper.xml b/src/main/resources/mapper/secondary/AttributeRetrievalMapper.xml index 85113c9f..8065dc00 100644 --- a/src/main/resources/mapper/secondary/AttributeRetrievalMapper.xml +++ b/src/main/resources/mapper/secondary/AttributeRetrievalMapper.xml @@ -29,6 +29,10 @@ AND silhouette = #{attributeRetrievalAttrDict.silhouette} + + AND style = #{style} + + AND deprecated = 0 ORDER BY RAND() @@ -40,6 +44,12 @@ * FROM ${tableName} + + + AND style = #{style} + + AND deprecated = 0 + ORDER BY RAND() LIMIT 1 @@ -60,6 +70,10 @@ AND subtype = #{attributeRetrievalAttrDict.subtype} + + AND style = #{style} + + AND deprecated = 0 ORDER BY RAND() @@ -79,4 +93,13 @@ set style = #{style} where ID = #{id} + + + UPDATE + ${tableName} + SET + style = #{style} + WHERE + image_name = #{fileName} + From bc240cd2ee516a6276db526bccac8ed6ad399237 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Thu, 27 Jun 2024 17:36:47 +0800 Subject: [PATCH 04/11] TASK:aida; --- .../com/ai/da/model/dto/ModelsDotDTO.java | 2 ++ .../java/com/ai/da/python/PythonService.java | 28 +++++++++++-------- .../secondary/AttributeRetrievalMapper.xml | 6 ++-- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/ai/da/model/dto/ModelsDotDTO.java b/src/main/java/com/ai/da/model/dto/ModelsDotDTO.java index 13d05050..f6a20db7 100644 --- a/src/main/java/com/ai/da/model/dto/ModelsDotDTO.java +++ b/src/main/java/com/ai/da/model/dto/ModelsDotDTO.java @@ -71,4 +71,6 @@ public class ModelsDotDTO implements Serializable { */ private String templateUrl; + private String sex; + } diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index da8def64..26027876 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -2800,24 +2800,28 @@ public class PythonService { private List coverToModelsDotPythonItem(ModelsDotDTO modelsDotDTO) { List response = Lists.newArrayList(); - if (modelsDotDTO.getTemplateUrl().contains("female")) { -// DesignPythonItem dress = new DesignPythonItem(); -// dress.setType(SysFileLevel2TypeEnum.DRESS.getRealName()); -// dress.setColor("none"); -// dress.setIcon("none"); + if (modelsDotDTO.getSex().contains("Female")) { + DesignPythonItem dress = new DesignPythonItem(); + dress.setType(SysFileLevel2TypeEnum.BLOUSE.getRealName()); + dress.setColor("none"); + dress.setIcon("none"); DesignPythonItemPrint designPythonItemPrint = new DesignPythonItemPrint(); designPythonItemPrint.setIfSingle(false); designPythonItemPrint.setPrint_path_list(new ArrayList<>()); -// dress.setPrint(designPythonItemPrint); -// dress.setPath("aida-sys-image/images/female/blouse/blouse_p5_817.jpg"); -// response.add(dress); + dress.setPrint(designPythonItemPrint); + dress.setPath("aida-sys-image/images/female/blouse/0628001551.jpg"); + response.add(dress); DesignPythonItem skirt = new DesignPythonItem(); - skirt.setType(SysFileLevel2TypeEnum.DRESS.getRealName()); + skirt.setType(SysFileLevel2TypeEnum.SKIRT.getRealName()); skirt.setColor("none"); skirt.setIcon("none"); - skirt.setPrint(designPythonItemPrint); - skirt.setPath("aida-sys-image/images/female/dress/0628002038.jpeg"); + DesignPythonItemPrint designPythonItemPrint1 = new DesignPythonItemPrint(); + designPythonItemPrint1.setIfSingle(false); + designPythonItemPrint1.setPrint_path_list(new ArrayList<>()); + skirt.setPrint(designPythonItemPrint1); + skirt.setPath("aida-sys-image/images/female/skirt/0628000022.jpg"); +// skirt.setPath("aida-sys-image/images/female/dress/0628000000.jpg"); response.add(skirt); } else { DesignPythonItem top = new DesignPythonItem(); @@ -2839,7 +2843,7 @@ public class PythonService { designPythonItemPrint1.setIfSingle(false); designPythonItemPrint1.setPrint_path_list(new ArrayList<>()); bottom.setPrint(designPythonItemPrint1); - bottom.setPath("aida-sys-image/images/male/bottoms/mens_test_12.png"); + bottom.setPath("aida-sys-image/images/male/bottoms/mens_test_6252.png"); response.add(bottom); } diff --git a/src/main/resources/mapper/secondary/AttributeRetrievalMapper.xml b/src/main/resources/mapper/secondary/AttributeRetrievalMapper.xml index 8065dc00..bcdfa819 100644 --- a/src/main/resources/mapper/secondary/AttributeRetrievalMapper.xml +++ b/src/main/resources/mapper/secondary/AttributeRetrievalMapper.xml @@ -32,7 +32,7 @@ AND style = #{style} - AND deprecated = 0 + ORDER BY RAND() @@ -48,7 +48,7 @@ AND style = #{style} - AND deprecated = 0 + ORDER BY RAND() @@ -73,7 +73,7 @@ AND style = #{style} - AND deprecated = 0 + ORDER BY RAND() From 4211bce256884cb46698699b841f7a6217056980 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Fri, 28 Jun 2024 15:45:39 +0800 Subject: [PATCH 05/11] BUGFIX:aida; --- .../com/ai/da/model/dto/DesignCollectionPrintElementDTO.java | 2 ++ .../com/ai/da/service/impl/CollectionElementServiceImpl.java | 3 +++ src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java | 3 +++ 3 files changed, 8 insertions(+) diff --git a/src/main/java/com/ai/da/model/dto/DesignCollectionPrintElementDTO.java b/src/main/java/com/ai/da/model/dto/DesignCollectionPrintElementDTO.java index 18853d95..50d4f679 100644 --- a/src/main/java/com/ai/da/model/dto/DesignCollectionPrintElementDTO.java +++ b/src/main/java/com/ai/da/model/dto/DesignCollectionPrintElementDTO.java @@ -14,6 +14,8 @@ public class DesignCollectionPrintElementDTO { @ApiModelProperty("design类型 用户design生成时候区别library和collection") private String designType; + private String level2Type; + @ApiModelProperty("是否pin 1 pin 0 不pin") private Byte isPin; diff --git a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java index 3fd813e2..b1f1156e 100644 --- a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java @@ -668,6 +668,9 @@ public class CollectionElementServiceImpl extends ServiceImpl collectionElementRelationListNew = new ArrayList<>(); for (CollectionElement element : collectionElementListOld) { From dd8f5696a2f2ffb99b2ebae2e080c6583e469a27 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Fri, 28 Jun 2024 16:52:16 +0800 Subject: [PATCH 06/11] BUGFIX:aida; --- .../ai/da/mapper/primary/entity/Portfolio.java | 4 ++++ .../da/mapper/primary/entity/UserLikeGroup.java | 4 ++++ .../ai/da/service/impl/PortfolioServiceImpl.java | 16 +++++++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/mapper/primary/entity/Portfolio.java b/src/main/java/com/ai/da/mapper/primary/entity/Portfolio.java index 8f15354a..f8cff637 100644 --- a/src/main/java/com/ai/da/mapper/primary/entity/Portfolio.java +++ b/src/main/java/com/ai/da/mapper/primary/entity/Portfolio.java @@ -47,6 +47,10 @@ public class Portfolio implements Serializable { @ApiModelProperty(value = "是否允许二次创作1允许0不允许") private Integer openSource; + private Integer original; + + private Long originalAccountId; + @ApiModelProperty(value = "作品集作者ID") private Long accountId; diff --git a/src/main/java/com/ai/da/mapper/primary/entity/UserLikeGroup.java b/src/main/java/com/ai/da/mapper/primary/entity/UserLikeGroup.java index 2aa8cc0e..1747c83b 100644 --- a/src/main/java/com/ai/da/mapper/primary/entity/UserLikeGroup.java +++ b/src/main/java/com/ai/da/mapper/primary/entity/UserLikeGroup.java @@ -43,6 +43,10 @@ public class UserLikeGroup implements Serializable { */ private String name; + private Integer original; + + private Long originalAccountId; + /** * 创建时间 */ diff --git a/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java b/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java index fb7a43f3..664e73de 100644 --- a/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java @@ -110,7 +110,8 @@ public class PortfolioServiceImpl extends ServiceImpl Date: Tue, 2 Jul 2024 13:48:53 +0800 Subject: [PATCH 07/11] BUGFIX:aida; --- .../com/ai/da/model/dto/ToProductImageDTO.java | 2 ++ .../java/com/ai/da/model/vo/PortfolioVO.java | 2 ++ .../com/ai/da/model/vo/UserLikeGroupVO.java | 4 ++++ .../java/com/ai/da/python/PythonService.java | 7 +++++-- .../da/service/impl/PortfolioServiceImpl.java | 6 ++++++ .../service/impl/UserLikeGroupServiceImpl.java | 18 +++++++++++++----- 6 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/ai/da/model/dto/ToProductImageDTO.java b/src/main/java/com/ai/da/model/dto/ToProductImageDTO.java index 25af4ec5..e51f5fd7 100644 --- a/src/main/java/com/ai/da/model/dto/ToProductImageDTO.java +++ b/src/main/java/com/ai/da/model/dto/ToProductImageDTO.java @@ -3,6 +3,7 @@ package com.ai.da.model.dto; import com.ai.da.model.vo.ToProductImageVO; import lombok.Data; +import java.math.BigDecimal; import java.util.List; @Data @@ -10,4 +11,5 @@ public class ToProductImageDTO { private Long userLikeGroupId; private List toProductImageVOList; private String prompt; + private BigDecimal imageStrength; } diff --git a/src/main/java/com/ai/da/model/vo/PortfolioVO.java b/src/main/java/com/ai/da/model/vo/PortfolioVO.java index 12e9199b..de059c3c 100644 --- a/src/main/java/com/ai/da/model/vo/PortfolioVO.java +++ b/src/main/java/com/ai/da/model/vo/PortfolioVO.java @@ -18,4 +18,6 @@ public class PortfolioVO extends Portfolio { private Long viewNums; private String userName; + + private String originalUserName; } diff --git a/src/main/java/com/ai/da/model/vo/UserLikeGroupVO.java b/src/main/java/com/ai/da/model/vo/UserLikeGroupVO.java index a796d902..8f35521b 100644 --- a/src/main/java/com/ai/da/model/vo/UserLikeGroupVO.java +++ b/src/main/java/com/ai/da/model/vo/UserLikeGroupVO.java @@ -22,6 +22,10 @@ public class UserLikeGroupVO { @ApiModelProperty("创建者") private String author; + private Integer original; + + private Long originalAccountId; + @ApiModelProperty("更新时间") private Long updateDate; diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 26027876..f9a48575 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -3311,7 +3311,7 @@ public class PythonService { return text; } - public Boolean toProductImage(String url, String taskId, String prompt) { + public Boolean toProductImage(String url, String taskId, String prompt, BigDecimal imageStrength) { // todo 限流校验 // AccessLimitUtils.validate("design",5); OkHttpClient client = new OkHttpClient().newBuilder() @@ -3322,12 +3322,14 @@ public class PythonService { .build(); MediaType mediaType = MediaType.parse("application/json"); //关闭FastJson的引用检测 防止出现$ref 现象 - Map map = new HashMap<>(); + Map map = new HashMap<>(); map.put("tasks_id", taskId); map.put("image_url", url); map.put("prompt", prompt); + map.put("image_strength", imageStrength); log.info("toProductImage请求python 参数:####{}", map); String param = JSON.toJSONString(map, SerializerFeature.WriteNullStringAsEmpty); + System.out.println(param); RequestBody body = RequestBody.create(mediaType, param); Request request = new Request.Builder() // .url(accessPythonIp + ":" + accessPythonPort + "/api/generate_product_image") @@ -3370,6 +3372,7 @@ public class PythonService { map.put("prompt", prompt); log.info("relightImage请求python 参数:####{}", map); String param = JSON.toJSONString(map, SerializerFeature.WriteNullStringAsEmpty); + log.info(param); RequestBody body = RequestBody.create(mediaType, param); Request request = new Request.Builder() // .url(accessPythonIp + ":" + accessPythonPort + "/api/generate_product_image") diff --git a/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java b/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java index 664e73de..3144ed5b 100644 --- a/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java @@ -408,6 +408,9 @@ public class PortfolioServiceImpl extends ServiceImpl Date: Tue, 2 Jul 2024 15:23:27 +0800 Subject: [PATCH 08/11] BUGFIX:aida; --- .../da/mapper/primary/entity/Portfolio.java | 2 ++ .../mapper/primary/entity/UserLikeGroup.java | 2 ++ .../java/com/ai/da/model/vo/PortfolioVO.java | 2 ++ .../da/service/impl/PortfolioServiceImpl.java | 33 ++++++++++++++++--- 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/ai/da/mapper/primary/entity/Portfolio.java b/src/main/java/com/ai/da/mapper/primary/entity/Portfolio.java index f8cff637..258012f1 100644 --- a/src/main/java/com/ai/da/mapper/primary/entity/Portfolio.java +++ b/src/main/java/com/ai/da/mapper/primary/entity/Portfolio.java @@ -51,6 +51,8 @@ public class Portfolio implements Serializable { private Long originalAccountId; + private Long originalPortfolioId; + @ApiModelProperty(value = "作品集作者ID") private Long accountId; diff --git a/src/main/java/com/ai/da/mapper/primary/entity/UserLikeGroup.java b/src/main/java/com/ai/da/mapper/primary/entity/UserLikeGroup.java index 1747c83b..4f3867ca 100644 --- a/src/main/java/com/ai/da/mapper/primary/entity/UserLikeGroup.java +++ b/src/main/java/com/ai/da/mapper/primary/entity/UserLikeGroup.java @@ -47,6 +47,8 @@ public class UserLikeGroup implements Serializable { private Long originalAccountId; + private Long originalPortfolioId; + /** * 创建时间 */ diff --git a/src/main/java/com/ai/da/model/vo/PortfolioVO.java b/src/main/java/com/ai/da/model/vo/PortfolioVO.java index de059c3c..fb7b7366 100644 --- a/src/main/java/com/ai/da/model/vo/PortfolioVO.java +++ b/src/main/java/com/ai/da/model/vo/PortfolioVO.java @@ -20,4 +20,6 @@ public class PortfolioVO extends Portfolio { private String userName; private String originalUserName; + + private String originalPortfolioName; } diff --git a/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java b/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java index 3144ed5b..b8637efb 100644 --- a/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java @@ -97,8 +97,15 @@ public class PortfolioServiceImpl extends ServiceImpl existSameNameQw = new QueryWrapper<>(); + existSameNameQw.lambda().eq(Portfolio::getPortfolioName, portfolioDTO.getPortfolioName()); + List portfoliosSameName = portfolioMapper.selectList(existSameNameQw); + if (!CollectionUtils.isEmpty(portfoliosSameName)) { + throw new BusinessException("The title of the published work has been used."); + } AuthPrincipalVo authPrincipalVo = UserContext.getUserHolder(); if (file != null && file.getOriginalFilename() != null) { String upload = minioUtil.upload("aida-canvas", String.valueOf(authPrincipalVo.getId()), file); @@ -141,8 +148,9 @@ public class PortfolioServiceImpl extends ServiceImpl existSameNameQw = new QueryWrapper<>(); + existSameNameQw.lambda().ne(Portfolio::getId, portfolioDTO.getId()); + existSameNameQw.lambda().eq(Portfolio::getPortfolioName, portfolioDTO.getPortfolioName()); + List portfoliosSameName = portfolioMapper.selectList(existSameNameQw); + if (!CollectionUtils.isEmpty(portfoliosSameName)) { + throw new BusinessException("The title of the published work has been used."); + } if (portfolioDTO.getPortfolioType().equals("History")) { AuthPrincipalVo authPrincipalVo = UserContext.getUserHolder(); UserLikeGroup userLikeGroup = userLikeGroupMapper.selectById(portfolioDTO.getUserLikeGroupId()); @@ -459,6 +475,7 @@ public class PortfolioServiceImpl extends ServiceImpl Date: Wed, 3 Jul 2024 15:22:01 +0800 Subject: [PATCH 09/11] BUGFIX:aida; --- .../java/com/ai/da/python/PythonService.java | 2 +- .../da/service/impl/PortfolioServiceImpl.java | 51 +++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index f9a48575..6e0d1d10 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -3377,7 +3377,7 @@ public class PythonService { Request request = new Request.Builder() // .url(accessPythonIp + ":" + accessPythonPort + "/api/generate_product_image") // .url(accessPythonIp + ":9996/api/generate_product_image") - .url(accessPythonIp + ":9994/api/generate_relight_image") + .url(accessPythonIp + ":9996/api/generate_relight_image") .method("POST", body) .addHeader("Authorization", "Basic YWlkbGFiOjEyMw==") .addHeader("Content-Type", "application/json") diff --git a/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java b/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java index b8637efb..0a320af5 100644 --- a/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java @@ -26,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; import org.springframework.web.multipart.MultipartFile; +import sun.security.krb5.internal.crypto.Des; import javax.annotation.Resource; import java.math.BigDecimal; @@ -96,6 +97,12 @@ public class PortfolioServiceImpl extends ServiceImpl getWorkspaceQw = new QueryWrapper<>(); + getWorkspaceQw.lambda().eq(Design::getCollectionId, collectionId); + List designs = designMapper.selectList(getWorkspaceQw); + if (!CollectionUtils.isEmpty(designs)) { + Design design1 = designs.get(0); + Long accountId = authPrincipalVo.getId(); + QueryWrapper currentWorkspaceQw = new QueryWrapper<>(); + currentWorkspaceQw.lambda().eq(Workspace::getAccountId, accountId); + currentWorkspaceQw.lambda().eq(Workspace::getIsLastIndex, 1); + List workspaces = workspaceMapper.selectList(currentWorkspaceQw); + if (!CollectionUtils.isEmpty(workspaces)) { + Workspace workspace1 = workspaces.get(0); + workspace1.setIsLastIndex(0); + + Workspace workspaceNew = new Workspace(); + workspaceNew.setWorkSpaceName("workspace of " + portfolio.getPortfolioName()); + workspaceNew.setAccountId(accountId); + workspaceNew.setIsDeleted(0); + workspaceNew.setIsLastIndex(1); + if (design1.getModelType().equals("System")) { + SysFile sysFile = sysFileMapper.selectById(design1.getTemplateId()); + if (sysFile.getLevel2Type().equals("Female")) { + workspaceNew.setSex("Female"); + workspaceNew.setMannequinFemaleId(design1.getTemplateId()); + QueryWrapper getAnotherOneQw = new QueryWrapper<>(); + getAnotherOneQw.lambda().eq(SysFile::getLevel1Type, "Models") + }else { + workspaceNew.setSex("Male"); + workspaceNew.setMannequinMaleId(design1.getTemplateId()); + } + if (design1.getSingleOverall().equals("overall")) { + workspaceNew.setPosition("Overall"); + }else { + workspaceNew.setPosition(design1.getSwitchCategory()); + } + } + workspaceNew.setSex(); + } + + + + } + return userLikeGroupService.choose(userLikeGroupNew.getId()); } From 4a533b3cf0405a733fe240aa84714c70b7343b92 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Thu, 4 Jul 2024 11:34:51 +0800 Subject: [PATCH 10/11] BUGFIX:aida; --- .../controller/SavedCollectionController.java | 6 + .../ai/da/model/dto/ToProductImageDTO.java | 1 + .../com/ai/da/model/vo/MagicToolResultVO.java | 2 + .../com/ai/da/model/vo/UserLikeGroupVO.java | 5 + .../java/com/ai/da/python/PythonService.java | 3 +- .../da/service/impl/PortfolioServiceImpl.java | 124 ++++++++++++++---- .../impl/UserLikeGroupServiceImpl.java | 6 +- 7 files changed, 117 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/ai/da/controller/SavedCollectionController.java b/src/main/java/com/ai/da/controller/SavedCollectionController.java index 3942b5aa..b3f51429 100644 --- a/src/main/java/com/ai/da/controller/SavedCollectionController.java +++ b/src/main/java/com/ai/da/controller/SavedCollectionController.java @@ -49,6 +49,8 @@ public class SavedCollectionController { private MinioUtil minioUtil; @Resource private ClassificationService classificationService; + @Resource + private PortfolioService portfolioService; @ApiOperation(value = "History用户分页分组列表") @PostMapping("/queryUserGroup") @@ -122,6 +124,10 @@ public class SavedCollectionController { } userLikeGroupVO.setGroupDetails(details); userLikeGroupVO.setSketchCount(CollectionUtils.isEmpty(details) ? 0 : details.size()); + if (userLikeGroupVO.getOriginal() == 0) { + userLikeGroupVO.setOriginalAccountName(accountService.getById(userLikeGroupVO.getOriginalAccountId()).getUserName()); + userLikeGroupVO.setOriginalPortfolioName(portfolioService.getById(userLikeGroupVO.getOriginalPortfolioId()).getPortfolioName()); + } return userLikeGroupVO; } return null; diff --git a/src/main/java/com/ai/da/model/dto/ToProductImageDTO.java b/src/main/java/com/ai/da/model/dto/ToProductImageDTO.java index e51f5fd7..93263027 100644 --- a/src/main/java/com/ai/da/model/dto/ToProductImageDTO.java +++ b/src/main/java/com/ai/da/model/dto/ToProductImageDTO.java @@ -12,4 +12,5 @@ public class ToProductImageDTO { private List toProductImageVOList; private String prompt; private BigDecimal imageStrength; + private String direction; } diff --git a/src/main/java/com/ai/da/model/vo/MagicToolResultVO.java b/src/main/java/com/ai/da/model/vo/MagicToolResultVO.java index 2aabb67d..fb313f1a 100644 --- a/src/main/java/com/ai/da/model/vo/MagicToolResultVO.java +++ b/src/main/java/com/ai/da/model/vo/MagicToolResultVO.java @@ -22,4 +22,6 @@ public class MagicToolResultVO { private String category; private String sourceUrl; + + private String resultType; } diff --git a/src/main/java/com/ai/da/model/vo/UserLikeGroupVO.java b/src/main/java/com/ai/da/model/vo/UserLikeGroupVO.java index 8f35521b..34d207b6 100644 --- a/src/main/java/com/ai/da/model/vo/UserLikeGroupVO.java +++ b/src/main/java/com/ai/da/model/vo/UserLikeGroupVO.java @@ -26,6 +26,8 @@ public class UserLikeGroupVO { private Long originalAccountId; + private Long originalPortfolioId; + @ApiModelProperty("更新时间") private Long updateDate; @@ -35,4 +37,7 @@ public class UserLikeGroupVO { @ApiModelProperty("分组对应的详情 一次行带出来") private List groupDetails; + private String originalAccountName; + private String originalPortfolioName; + } diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 6e0d1d10..c5c5132e 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -3355,7 +3355,7 @@ public class PythonService { throw new BusinessException("toProductImage.interface.exception"); } - public Boolean relight(String url, String taskId, String prompt) { + public Boolean relight(String url, String taskId, String prompt, String direction) { // todo 限流校验 // AccessLimitUtils.validate("design",5); OkHttpClient client = new OkHttpClient().newBuilder() @@ -3370,6 +3370,7 @@ public class PythonService { map.put("tasks_id", taskId); map.put("image_url", url); map.put("prompt", prompt); + map.put("direction", direction); log.info("relightImage请求python 参数:####{}", map); String param = JSON.toJSONString(map, SerializerFeature.WriteNullStringAsEmpty); log.info(param); diff --git a/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java b/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java index 0a320af5..9742ebc1 100644 --- a/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java @@ -103,17 +103,27 @@ public class PortfolioServiceImpl extends ServiceImpl existSameNameQw = new QueryWrapper<>(); existSameNameQw.lambda().eq(Portfolio::getPortfolioName, portfolioDTO.getPortfolioName()); + existSameNameQw.lambda().eq(Portfolio::getAccountId, authPrincipalVo.getId()); List portfoliosSameName = portfolioMapper.selectList(existSameNameQw); if (!CollectionUtils.isEmpty(portfoliosSameName)) { throw new BusinessException("The title of the published work has been used."); } - AuthPrincipalVo authPrincipalVo = UserContext.getUserHolder(); if (file != null && file.getOriginalFilename() != null) { String upload = minioUtil.upload("aida-canvas", String.valueOf(authPrincipalVo.getId()), file); Canvas canvas = new Canvas(); @@ -128,11 +138,17 @@ public class PortfolioServiceImpl extends ServiceImpl designQueryWrapper = new QueryWrapper<>(); + designQueryWrapper.lambda().eq(Design::getCollectionId, collectionIdOld); + Design designOld = designMapper.selectOne(designQueryWrapper); Collection collectionOld = collectionMapper.selectById(collectionIdOld); List collectionElementListOld = collectionElementService.getByCollectionId(collectionIdOld); collectionOld.setId(null); collectionMapper.insert(collectionOld); Long collectionIdNew = collectionOld.getId(); + designOld.setCollectionId(collectionIdNew); + designOld.setId(null); + designMapper.insert(designOld); userLikeGroupNew.setCollectionId(collectionIdNew); userLikeGroupMapper.insert(userLikeGroupNew); for (CollectionElement element : collectionElementListOld) { @@ -179,17 +195,12 @@ public class PortfolioServiceImpl extends ServiceImpl userLikeList = userLikeService.getUserLikeList(portfolioDTO.getUserLikeGroupId()); -// Long coverIdNew = null; -// Boolean flag = false; for (UserLike userLike : userLikeList) { Long designOutfitIdOld = userLike.getDesignOutfitId(); TDesignPythonOutfit designPythonOutfit = designPythonOutfitMapper.selectById(designOutfitIdOld); designPythonOutfit.setDesignId(-1L); designPythonOutfit.setDesignItemId(-1L); designPythonOutfit.setCollectionId(collectionIdNew); -// if (designPythonOutfit.getId().equals(coverIdOld)) { -// flag = true; -// } designPythonOutfit.setId(null); Long designItemIdOld = userLike.getDesignItemId(); DesignItem designItemOld = designItemMapper.selectById(designItemIdOld); @@ -208,21 +219,12 @@ public class PortfolioServiceImpl extends ServiceImpl tDesignPythonOutfitDetails = designPythonOutfitDetailMapper.selectList(qw); for (TDesignPythonOutfitDetail tDesignPythonOutfitDetail : tDesignPythonOutfitDetails) { -// Long designPythonOutfitDetailIdOld = tDesignPythonOutfitDetail.getId(); tDesignPythonOutfitDetail.setId(null); tDesignPythonOutfitDetail.setDesignId(-1L); tDesignPythonOutfitDetail.setDesignPythonOutfitId(designOutfitIdNew); designPythonOutfitDetailMapper.insert(tDesignPythonOutfitDetail); } -// if (flag) { -// coverIdNew = designOutfitIdNew; -// portfolio.setCoverId(coverIdNew); -// portfolioMapper.updateById(portfolio); -// flag = false; -// } -// designPythonOutfitMapper.updateById(designPythonOutfit); - userLike.setDesignItemId(designItemIdNew); userLike.setId(null); userLike.setDesignId(-1L); @@ -283,15 +285,16 @@ public class PortfolioServiceImpl extends ServiceImpl existSameNameQw = new QueryWrapper<>(); existSameNameQw.lambda().ne(Portfolio::getId, portfolioDTO.getId()); existSameNameQw.lambda().eq(Portfolio::getPortfolioName, portfolioDTO.getPortfolioName()); + existSameNameQw.lambda().eq(Portfolio::getAccountId, authPrincipalVo.getId()); List portfoliosSameName = portfolioMapper.selectList(existSameNameQw); if (!CollectionUtils.isEmpty(portfoliosSameName)) { throw new BusinessException("The title of the published work has been used."); } if (portfolioDTO.getPortfolioType().equals("History")) { - AuthPrincipalVo authPrincipalVo = UserContext.getUserHolder(); UserLikeGroup userLikeGroup = userLikeGroupMapper.selectById(portfolioDTO.getUserLikeGroupId()); UserLikeGroup userLikeGroupNew = userLikeGroup.setId(null); userLikeGroupNew.setAccountId(-1L); @@ -499,9 +502,9 @@ public class PortfolioServiceImpl extends ServiceImpl collectionElementRelationListNew = new ArrayList<>(); for (CollectionElement element : collectionElementListOld) { @@ -638,34 +641,101 @@ public class PortfolioServiceImpl extends ServiceImpl getAnotherOneQw = new QueryWrapper<>(); - getAnotherOneQw.lambda().eq(SysFile::getLevel1Type, "Models") + getAnotherOneQw.lambda().eq(SysFile::getLevel1Type, "Models"); + getAnotherOneQw.lambda().eq(SysFile::getLevel2Type, "Male"); + if (!StringUtils.isEmpty(sysFile.getLevel3Type())) { + getAnotherOneQw.lambda().eq(SysFile::getLevel3Type, sysFile.getLevel3Type()); + QueryWrapper