Merge remote-tracking branch 'origin/dev-ltx' into dev/3.1_release_merge
This commit is contained in:
@@ -24,4 +24,5 @@ public interface WorkspaceMapper extends CommonMapper<Workspace> {
|
|||||||
*/
|
*/
|
||||||
List<WorkspaceVO> selectWorkspacePage(IPage page, WorkspaceVO workspace);
|
List<WorkspaceVO> selectWorkspacePage(IPage page, WorkspaceVO workspace);
|
||||||
|
|
||||||
|
String getStyleByProjectId(Long projectId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,4 +30,8 @@ public interface AttributeRetrievalMapper {
|
|||||||
void updateStyleByFileName(String style, String fileName, String tableName);
|
void updateStyleByFileName(String style, String fileName, String tableName);
|
||||||
|
|
||||||
String getStyleByUrl(String replace,String tableName);
|
String getStyleByUrl(String replace,String tableName);
|
||||||
|
|
||||||
|
Integer getCountByStyle(String tableName, String style);
|
||||||
|
|
||||||
|
String getOneSystemSketchRadom(String tableName, String style, Integer randomNum);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ public enum FemalePosition implements IEnumDisplay {
|
|||||||
BLOUSE("Blouse"),
|
BLOUSE("Blouse"),
|
||||||
DRESS("Dress"),
|
DRESS("Dress"),
|
||||||
TROUSERS("Trousers"),
|
TROUSERS("Trousers"),
|
||||||
SKIRT("Skirt");
|
SKIRT("Skirt"),
|
||||||
|
OTHERS("Others");
|
||||||
|
|
||||||
private String value;
|
private String value;
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ public enum MalePosition implements IEnumDisplay {
|
|||||||
|
|
||||||
TOPS("Tops"),
|
TOPS("Tops"),
|
||||||
BOTTOMS("Bottoms"),
|
BOTTOMS("Bottoms"),
|
||||||
OUTWEAR("Outwear");
|
OUTWEAR("Outwear"),
|
||||||
|
OTHERS("Others");
|
||||||
|
|
||||||
private String value;
|
private String value;
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ public enum Position implements IEnumDisplay {
|
|||||||
SKIRT("Skirt"),
|
SKIRT("Skirt"),
|
||||||
SLOGAN("Slogan"),
|
SLOGAN("Slogan"),
|
||||||
LOGO("Logo"),
|
LOGO("Logo"),
|
||||||
PATTERN("Pattern");
|
PATTERN("Pattern"),
|
||||||
|
OTHERS("Others");
|
||||||
|
|
||||||
private String value;
|
private String value;
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import com.google.common.collect.Maps;
|
|||||||
import io.netty.util.internal.StringUtil;
|
import io.netty.util.internal.StringUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import okhttp3.*;
|
import okhttp3.*;
|
||||||
|
import org.apache.commons.lang3.RandomUtils;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -666,32 +667,23 @@ public class PythonService {
|
|||||||
BigDecimal randomValue = generateRandomValue();
|
BigDecimal randomValue = generateRandomValue();
|
||||||
boolean useSystem = randomValue.compareTo(systemScale) <= 0;
|
boolean useSystem = randomValue.compareTo(systemScale) <= 0;
|
||||||
|
|
||||||
if (useSystem) {
|
// 用过存在用户上传,则优先使用用户上传
|
||||||
// 获取系统推荐sketch
|
if (!useSystem && CollectionUtil.isNotEmpty(collectionElements)) {
|
||||||
String categoryParam = elementVO.getModelSex().toLowerCase() + "_" + styleCategory.toLowerCase();
|
|
||||||
List<String> recommentdUrlList = getSystemSketchByCategory(categoryParam, elementVO.getBrandId(), elementVO.getBrandScale());
|
|
||||||
if (!CollectionUtils.isEmpty(recommentdUrlList)) {
|
|
||||||
String recommendSystemSketch = recommentdUrlList.get(0);
|
|
||||||
return coverSystemSketchUrlToDesignPythonItem(recommendSystemSketch, styleCategory, elementVO);
|
|
||||||
}else {
|
|
||||||
throw new BusinessException("failed.to.obtain.system.sketch.recommendation");
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
if (CollectionUtil.isNotEmpty(collectionElements)) {
|
|
||||||
int collectionNoPinSize = collectionElements.size();
|
int collectionNoPinSize = collectionElements.size();
|
||||||
int randomNum = RandomsUtil.randomSysFile(collectionNoPinSize);
|
int randomNum = RandomsUtil.randomSysFile(collectionNoPinSize);
|
||||||
return coverSketchToDesignPythonItem(collectionElements.get(randomNum).getId(), collectionElements.get(randomNum), elementVO);
|
return coverSketchToDesignPythonItem(collectionElements.get(randomNum).getId(), collectionElements.get(randomNum), elementVO);
|
||||||
}else {
|
}
|
||||||
|
|
||||||
|
// 其他所有情况,都回退到使用系统推荐
|
||||||
String categoryParam = elementVO.getModelSex().toLowerCase() + "_" + styleCategory.toLowerCase();
|
String categoryParam = elementVO.getModelSex().toLowerCase() + "_" + styleCategory.toLowerCase();
|
||||||
List<String> recommentdUrlList = getSystemSketchByCategory(categoryParam, elementVO.getBrandId(), elementVO.getBrandScale());
|
List<String> recommentdUrlList = getSystemSketchByCategory(categoryParam, elementVO.getBrandId(), elementVO.getBrandScale(),elementVO.getStyle());
|
||||||
if (!CollectionUtils.isEmpty(recommentdUrlList)) {
|
|
||||||
String recommendSystemSketch = recommentdUrlList.get(0);
|
if (CollectionUtils.isEmpty(recommentdUrlList)) {
|
||||||
return coverSystemSketchUrlToDesignPythonItem(recommendSystemSketch, styleCategory, elementVO);
|
|
||||||
}else {
|
|
||||||
throw new BusinessException("failed.to.obtain.system.sketch.recommendation");
|
throw new BusinessException("failed.to.obtain.system.sketch.recommendation");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
String recommendSystemSketch = recommentdUrlList.get(0);
|
||||||
|
return coverSystemSketchUrlToDesignPythonItem(recommendSystemSketch, styleCategory, elementVO);
|
||||||
|
|
||||||
// int poolNum = 20;
|
// int poolNum = 20;
|
||||||
// if (CollectionUtil.isNotEmpty(collectionElements)) {
|
// if (CollectionUtil.isNotEmpty(collectionElements)) {
|
||||||
@@ -1039,7 +1031,7 @@ public class PythonService {
|
|||||||
// 获取随机pin sketch的category
|
// 获取随机pin sketch的category
|
||||||
String category = element.getLevel2Type();
|
String category = element.getLevel2Type();
|
||||||
String categoryParam = validateElementVO.getModelSex().toLowerCase() + "_" + category.toLowerCase();
|
String categoryParam = validateElementVO.getModelSex().toLowerCase() + "_" + category.toLowerCase();
|
||||||
List<String> recommentdUrlList = getSystemSketchByCategory(categoryParam, validateElementVO.getBrandId(), validateElementVO.getBrandScale());
|
List<String> recommentdUrlList = getSystemSketchByCategory(categoryParam, validateElementVO.getBrandId(), validateElementVO.getBrandScale(), validateElementVO.getStyle());
|
||||||
if (!CollectionUtils.isEmpty(recommentdUrlList)) {
|
if (!CollectionUtils.isEmpty(recommentdUrlList)) {
|
||||||
String recommendSystemSketch = recommentdUrlList.get(0);
|
String recommendSystemSketch = recommentdUrlList.get(0);
|
||||||
return coverSystemSketchUrlToDesignPythonItem(recommendSystemSketch, category, validateElementVO);
|
return coverSystemSketchUrlToDesignPythonItem(recommendSystemSketch, category, validateElementVO);
|
||||||
@@ -1062,7 +1054,7 @@ public class PythonService {
|
|||||||
String category = dressings.get(randomNum).getStyleCategory();
|
String category = dressings.get(randomNum).getStyleCategory();
|
||||||
|
|
||||||
String categoryParam = validateElementVO.getModelSex().toLowerCase() + "_" + category.toLowerCase();
|
String categoryParam = validateElementVO.getModelSex().toLowerCase() + "_" + category.toLowerCase();
|
||||||
List<String> recommentdUrlList = getSystemSketchByCategory(categoryParam, validateElementVO.getBrandId(), validateElementVO.getBrandScale());
|
List<String> recommentdUrlList = getSystemSketchByCategory(categoryParam, validateElementVO.getBrandId(), validateElementVO.getBrandScale(), validateElementVO.getStyle());
|
||||||
if (!CollectionUtils.isEmpty(recommentdUrlList)) {
|
if (!CollectionUtils.isEmpty(recommentdUrlList)) {
|
||||||
String recommendSystemSketch = recommentdUrlList.get(0);
|
String recommendSystemSketch = recommentdUrlList.get(0);
|
||||||
return coverSystemSketchUrlToDesignPythonItem(recommendSystemSketch, category, validateElementVO);
|
return coverSystemSketchUrlToDesignPythonItem(recommendSystemSketch, category, validateElementVO);
|
||||||
@@ -1098,7 +1090,7 @@ public class PythonService {
|
|||||||
String category = element.getLevel2Type();
|
String category = element.getLevel2Type();
|
||||||
|
|
||||||
String categoryParam = validateElementVO.getModelSex().toLowerCase() + "_" + category.toLowerCase();
|
String categoryParam = validateElementVO.getModelSex().toLowerCase() + "_" + category.toLowerCase();
|
||||||
List<String> recommentdUrlList = getSystemSketchByCategory(categoryParam, validateElementVO.getBrandId(), validateElementVO.getBrandScale());
|
List<String> recommentdUrlList = getSystemSketchByCategory(categoryParam, validateElementVO.getBrandId(), validateElementVO.getBrandScale(), validateElementVO.getStyle());
|
||||||
if (!CollectionUtils.isEmpty(recommentdUrlList)) {
|
if (!CollectionUtils.isEmpty(recommentdUrlList)) {
|
||||||
String recommendSystemSketch = recommentdUrlList.get(0);
|
String recommendSystemSketch = recommentdUrlList.get(0);
|
||||||
return coverSystemSketchUrlToDesignPythonItem(recommendSystemSketch, category, validateElementVO);
|
return coverSystemSketchUrlToDesignPythonItem(recommendSystemSketch, category, validateElementVO);
|
||||||
@@ -1122,7 +1114,7 @@ public class PythonService {
|
|||||||
String category = dressings.get(randomNum).getStyleCategory();
|
String category = dressings.get(randomNum).getStyleCategory();
|
||||||
|
|
||||||
String categoryParam = validateElementVO.getModelSex().toLowerCase() + "_" + category.toLowerCase();
|
String categoryParam = validateElementVO.getModelSex().toLowerCase() + "_" + category.toLowerCase();
|
||||||
List<String> recommentdUrlList = getSystemSketchByCategory(categoryParam, validateElementVO.getBrandId(), validateElementVO.getBrandScale());
|
List<String> recommentdUrlList = getSystemSketchByCategory(categoryParam, validateElementVO.getBrandId(), validateElementVO.getBrandScale(), validateElementVO.getStyle());
|
||||||
if (!CollectionUtils.isEmpty(recommentdUrlList)) {
|
if (!CollectionUtils.isEmpty(recommentdUrlList)) {
|
||||||
String recommendSystemSketch = recommentdUrlList.get(0);
|
String recommendSystemSketch = recommentdUrlList.get(0);
|
||||||
return coverSystemSketchUrlToDesignPythonItem(recommendSystemSketch, category, validateElementVO);
|
return coverSystemSketchUrlToDesignPythonItem(recommendSystemSketch, category, validateElementVO);
|
||||||
@@ -3962,7 +3954,30 @@ public class PythonService {
|
|||||||
throw new BusinessException("design.interface.exception");
|
throw new BusinessException("design.interface.exception");
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getSystemSketchByCategory(String category, Long brandId, Double brandScale) {
|
public List<String> getSystemSketchByCategory(String category, Long brandId, Double brandScale,String style) {
|
||||||
|
//******3.1.2版本临时使用java推荐方案去解决style未使用的问题**********
|
||||||
|
try {
|
||||||
|
//使用新库attribute_retrieval_style,表命名修改为elementVO.getModelSex().toLowerCase() + "_" + styleCategory.toLowerCase()比如female_skirt,与传入的category保持一致
|
||||||
|
Integer countByStyle = attributeRetrievalMapper.getCountByStyle(category, style);
|
||||||
|
//根据数量随机获取一个系统sketch
|
||||||
|
if (countByStyle > 0) {
|
||||||
|
//获取一个不大于countByStyle的随机整数
|
||||||
|
Integer randomNum = RandomUtils.nextInt(0, countByStyle);
|
||||||
|
//返回格式为 dress/0902000649.jpg
|
||||||
|
String oneSystemSketchRadom = attributeRetrievalMapper.getOneSystemSketchRadom(category, style,randomNum);
|
||||||
|
String imgName = oneSystemSketchRadom.split("/")[1];
|
||||||
|
//补齐正确格式aida-sys-image/images/male/tops/mens_test_5689.png
|
||||||
|
//裁切category前半部分
|
||||||
|
String sex = category.split("_")[0];
|
||||||
|
String realCategory = category.split("_")[1];
|
||||||
|
String path = "aida-sys-image/images/" + sex + "/" +realCategory +"/" +imgName;
|
||||||
|
return Arrays.asList(path);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.info("推荐失败:{}",e.getMessage());
|
||||||
|
throw new BusinessException("system.error");
|
||||||
|
}
|
||||||
|
//**********************end***********************************
|
||||||
AuthPrincipalVo userHolder = UserContext.getUserHolder();
|
AuthPrincipalVo userHolder = UserContext.getUserHolder();
|
||||||
|
|
||||||
OkHttpClient client = new OkHttpClient().newBuilder()
|
OkHttpClient client = new OkHttpClient().newBuilder()
|
||||||
|
|||||||
@@ -105,6 +105,9 @@ public class DesignPythonItem {
|
|||||||
public static List<String> BOTTOMS = Arrays.asList(
|
public static List<String> BOTTOMS = Arrays.asList(
|
||||||
"Bottoms");
|
"Bottoms");
|
||||||
|
|
||||||
|
public static List<String> OTHERS = Arrays.asList(
|
||||||
|
"Others");
|
||||||
|
|
||||||
public static List<String> SYS_HAIRSTYLE_SHOES_BODY = Arrays.asList(
|
public static List<String> SYS_HAIRSTYLE_SHOES_BODY = Arrays.asList(
|
||||||
SysFileLevel2TypeEnum.HAIRSTYLE.getRealName(), SysFileLevel2TypeEnum.SHOES.getRealName(),
|
SysFileLevel2TypeEnum.HAIRSTYLE.getRealName(), SysFileLevel2TypeEnum.SHOES.getRealName(),
|
||||||
SysFileLevel2TypeEnum.EARRINGS.getRealName(), SysFileLevel2TypeEnum.BODY.getRealName());
|
SysFileLevel2TypeEnum.EARRINGS.getRealName(), SysFileLevel2TypeEnum.BODY.getRealName());
|
||||||
|
|||||||
@@ -68,4 +68,6 @@ public interface WorkspaceService extends IService<Workspace> {
|
|||||||
|
|
||||||
|
|
||||||
String getProjectSexById(Long projectId);
|
String getProjectSexById(Long projectId);
|
||||||
|
|
||||||
|
String getStyleByProjectId(Long projectId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
@Resource
|
@Resource
|
||||||
private MinioUtil minioUtil;
|
private MinioUtil minioUtil;
|
||||||
|
|
||||||
private WorkspaceService workspaceService;
|
private final WorkspaceService workspaceService;
|
||||||
|
|
||||||
@Value("${minio.bucketName.collectionElement}")
|
@Value("${minio.bucketName.collectionElement}")
|
||||||
private String collectionElement;
|
private String collectionElement;
|
||||||
@@ -644,7 +644,7 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
if (result) {
|
if (result) {
|
||||||
throw new BusinessException("sketchBoards.designType.cannot.be.empty");
|
throw new BusinessException("sketchBoards.designType.cannot.be.empty");
|
||||||
}
|
}
|
||||||
|
List<CollectionElement> sketchBoardElements = new ArrayList<>();
|
||||||
// 提取类型为COLLECTION的sketchBoard ID列表
|
// 提取类型为COLLECTION的sketchBoard ID列表
|
||||||
List<Long> sketchBoardIds = designDTO.getSketchBoards().stream()
|
List<Long> sketchBoardIds = designDTO.getSketchBoards().stream()
|
||||||
.filter(f -> f.getDesignType().equals(DesignTypeEnum.COLLECTION.getRealName()))
|
.filter(f -> f.getDesignType().equals(DesignTypeEnum.COLLECTION.getRealName()))
|
||||||
@@ -652,12 +652,12 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if (!CollectionUtils.isEmpty(sketchBoardIds)) {
|
if (!CollectionUtils.isEmpty(sketchBoardIds)) {
|
||||||
// 从数据库查询验证sketchBoard元素是否存在
|
// 从数据库查询验证sketchBoard元素是否存在
|
||||||
List<CollectionElement> sketchBoardElements = collectionElementMapper.selectBatchIds(sketchBoardIds);
|
sketchBoardElements = collectionElementMapper.selectBatchIds(sketchBoardIds);
|
||||||
|
|
||||||
if (CollectionUtil.isEmpty(sketchBoardElements) || sketchBoardElements.size() != sketchBoardIds.size()) {
|
if (CollectionUtil.isEmpty(sketchBoardElements) || sketchBoardElements.size() != sketchBoardIds.size()) {
|
||||||
throw new BusinessException("get.sketchBoards.data.is.mismatch");
|
throw new BusinessException("get.sketchBoards.data.is.mismatch");
|
||||||
}
|
}
|
||||||
// 设置验证通过的sketchBoard元素到结果对象
|
|
||||||
elementVO.setSketchBoardElements(sketchBoardElements);
|
|
||||||
// 记录已使用的元素ID
|
// 记录已使用的元素ID
|
||||||
usedElementIds.addAll(sketchBoardIds);
|
usedElementIds.addAll(sketchBoardIds);
|
||||||
}
|
}
|
||||||
@@ -675,7 +675,9 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
Map<Long, CollectionSketchDTO> idToMap = designDTO.getSketchBoards()
|
Map<Long, CollectionSketchDTO> idToMap = designDTO.getSketchBoards()
|
||||||
.stream()
|
.stream()
|
||||||
.collect(Collectors.toMap(CollectionSketchDTO::getSketchBoardId, v -> v));
|
.collect(Collectors.toMap(CollectionSketchDTO::getSketchBoardId, v -> v));
|
||||||
libraryCollectionElements.addAll(covertLibrarysToCollections(librarys, idToMap));
|
List<CollectionElement> librarysToCollections = covertLibrarysToCollections(librarys, idToMap);
|
||||||
|
libraryCollectionElements.addAll(librarysToCollections);
|
||||||
|
sketchBoardElements.addAll(librarysToCollections);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -691,9 +693,13 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
Map<Long, CollectionSketchDTO> idToMap = designDTO.getSketchBoards()
|
Map<Long, CollectionSketchDTO> idToMap = designDTO.getSketchBoards()
|
||||||
.stream()
|
.stream()
|
||||||
.collect(Collectors.toMap(CollectionSketchDTO::getSketchBoardId, v -> v));
|
.collect(Collectors.toMap(CollectionSketchDTO::getSketchBoardId, v -> v));
|
||||||
generateCollectionElements.addAll(covertGeneratesToCollections(generateDetailList, idToMap));
|
List<CollectionElement> generatesToCollections = covertGeneratesToCollections(generateDetailList, idToMap);
|
||||||
|
generateCollectionElements.addAll(generatesToCollections);
|
||||||
|
sketchBoardElements.addAll(generatesToCollections);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 设置验证通过的sketchBoard元素到结果对象
|
||||||
|
elementVO.setSketchBoardElements(sketchBoardElements);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//校验marketingSketch
|
//校验marketingSketch
|
||||||
@@ -796,7 +802,7 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
SysFileVO byId = sysFileService.getById(designDTO.getTemplateId());
|
SysFileVO byId = sysFileService.getById(designDTO.getTemplateId());
|
||||||
// 设置女性模特的风格类型
|
// 设置女性模特的风格类型
|
||||||
if (Objects.nonNull(byId) && !StringUtils.isEmpty(byId.getLevel3Type()) && byId.getLevel2Type().equals("Female")) {
|
if (Objects.nonNull(byId) && !StringUtils.isEmpty(byId.getLevel3Type()) && byId.getLevel2Type().equals("Female")) {
|
||||||
elementVO.setStyle(byId.getLevel3Type());
|
// elementVO.setStyle(byId.getLevel3Type());
|
||||||
}
|
}
|
||||||
LibraryModelPoint modelPoint = libraryModelPointService.getByRelationId(byId.getId(), designDTO.getModelType());
|
LibraryModelPoint modelPoint = libraryModelPointService.getByRelationId(byId.getId(), designDTO.getModelType());
|
||||||
elementVO.setDesignLibraryModelPoint(calculateTemplatePointTemplate(modelPoint, 700, 320, byId.getUrl()));
|
elementVO.setDesignLibraryModelPoint(calculateTemplatePointTemplate(modelPoint, 700, 320, byId.getUrl()));
|
||||||
@@ -821,6 +827,10 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
elementVO.setBrandScale(designDTO.getBrandScale()); // 设置品牌比例
|
elementVO.setBrandScale(designDTO.getBrandScale()); // 设置品牌比例
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//设置风格
|
||||||
|
String style = workspaceService.getStyleByProjectId(designDTO.getProjectId());
|
||||||
|
elementVO.setStyle(style);
|
||||||
|
|
||||||
// 返回验证结果对象
|
// 返回验证结果对象
|
||||||
return elementVO;
|
return elementVO;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1456,7 +1456,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
response.setHighDesignUrl(designItem.getHighDesignUrl());
|
response.setHighDesignUrl(designItem.getHighDesignUrl());
|
||||||
List<DesignItemDetail> filterDetail = designItemDetails.stream()
|
List<DesignItemDetail> filterDetail = designItemDetails.stream()
|
||||||
.filter(f -> OUTWEAR_DRESS_BLOUSE.contains(f.getType()) || SKIRT_TROUSERS.contains(f.getType())
|
.filter(f -> OUTWEAR_DRESS_BLOUSE.contains(f.getType()) || SKIRT_TROUSERS.contains(f.getType())
|
||||||
|| TOPS.contains(f.getType()) || BOTTOMS.contains(f.getType()))
|
|| TOPS.contains(f.getType()) || BOTTOMS.contains(f.getType())|| OTHERS.contains(f.getType()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
response.setClothes(CopyUtil.copyList(filterDetail, DesignItemClothesDetailVO.class, (o, d) -> {
|
response.setClothes(CopyUtil.copyList(filterDetail, DesignItemClothesDetailVO.class, (o, d) -> {
|
||||||
d.setId(o.getId());
|
d.setId(o.getId());
|
||||||
|
|||||||
@@ -867,6 +867,9 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
|||||||
if (base64Data != null && !base64Data.isEmpty()) {
|
if (base64Data != null && !base64Data.isEmpty()) {
|
||||||
String resultPath = userId + "/product_image" + "/" + uuid;
|
String resultPath = userId + "/product_image" + "/" + uuid;
|
||||||
String minioPath = minioUtil.base64UploadToPath("data:image/png;base64," + base64Data, userBucket, resultPath);
|
String minioPath = minioUtil.base64UploadToPath("data:image/png;base64," + base64Data, userBucket, resultPath);
|
||||||
|
if (StringUtil.isNullOrEmpty(minioPath)){
|
||||||
|
log.warn("Google API调用成功,但图片保存失败 for taskId: {}", taskId);
|
||||||
|
}
|
||||||
// 生成成功,更新Redis状态和URL
|
// 生成成功,更新Redis状态和URL
|
||||||
GenerateResultVO successResultVO = new GenerateResultVO(taskId, null, minioPath, "Success");
|
GenerateResultVO successResultVO = new GenerateResultVO(taskId, null, minioPath, "Success");
|
||||||
redisUtil.addToString(key, new Gson().toJson(successResultVO), CommonConstant.GENERATE_RESULT_EXPIRE_TIME);
|
redisUtil.addToString(key, new Gson().toJson(successResultVO), CommonConstant.GENERATE_RESULT_EXPIRE_TIME);
|
||||||
@@ -1495,9 +1498,6 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
|||||||
GenerateResultVO successResultVO = new GenerateResultVO(taskId, null, imageUrl, "Success");
|
GenerateResultVO successResultVO = new GenerateResultVO(taskId, null, imageUrl, "Success");
|
||||||
redisUtil.addToString(key, new Gson().toJson(successResultVO), CommonConstant.GENERATE_RESULT_EXPIRE_TIME);
|
redisUtil.addToString(key, new Gson().toJson(successResultVO), CommonConstant.GENERATE_RESULT_EXPIRE_TIME);
|
||||||
|
|
||||||
|
|
||||||
// TODO: 处理积分扣除逻辑
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Doubao image generation failed for taskId: {}", taskId, e);
|
log.error("Doubao image generation failed for taskId: {}", taskId, e);
|
||||||
LambdaQueryWrapper<Account> select = new LambdaQueryWrapper<Account>().eq(Account::getId, userId).select(Account::getLanguage);
|
LambdaQueryWrapper<Account> select = new LambdaQueryWrapper<Account>().eq(Account::getId, userId).select(Account::getLanguage);
|
||||||
|
|||||||
@@ -898,6 +898,11 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getStyleByProjectId(Long projectId) {
|
||||||
|
return workspaceMapper.getStyleByProjectId(projectId);
|
||||||
|
}
|
||||||
|
|
||||||
// 由于在数据库中表设计问题,目前只能通过路径来判断项目中是否存在某一个模特
|
// 由于在数据库中表设计问题,目前只能通过路径来判断项目中是否存在某一个模特
|
||||||
public Boolean checkIfModelExistsInProject(String md5, Long projectId) {
|
public Boolean checkIfModelExistsInProject(String md5, Long projectId) {
|
||||||
QueryWrapper<CollectionElement> qw = new QueryWrapper<>();
|
QueryWrapper<CollectionElement> qw = new QueryWrapper<>();
|
||||||
|
|||||||
@@ -27,5 +27,10 @@
|
|||||||
<select id="selectWorkspacePage" resultMap="BaseResultMap">
|
<select id="selectWorkspacePage" resultMap="BaseResultMap">
|
||||||
select * from workspace where is_deleted = 0
|
select * from workspace where is_deleted = 0
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getStyleByProjectId" resultType="java.lang.String">
|
||||||
|
select name from style where id =
|
||||||
|
(select style_id from workspace_rel_style where workspace_id =
|
||||||
|
(select id from workspace where project_id = #{projectId}))
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -110,4 +110,21 @@
|
|||||||
${tableName}
|
${tableName}
|
||||||
WHERE img_name = #{replace}
|
WHERE img_name = #{replace}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getCountByStyle" resultType="java.lang.Integer">
|
||||||
|
SELECT
|
||||||
|
count(*)
|
||||||
|
FROM
|
||||||
|
${tableName}
|
||||||
|
WHERE style = #{style} and deprecated = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getOneSystemSketchRadom" resultType="java.lang.String">
|
||||||
|
SELECT
|
||||||
|
img_name
|
||||||
|
FROM
|
||||||
|
${tableName}
|
||||||
|
WHERE style = #{style}
|
||||||
|
and deprecated = 0
|
||||||
|
ORDER BY ID LIMIT #{randomNum},1
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -231,6 +231,7 @@ OVERALL=Overall
|
|||||||
TOPS=Tops
|
TOPS=Tops
|
||||||
BOTTOMS=Bottoms
|
BOTTOMS=Bottoms
|
||||||
OUTWEAR=Outwear
|
OUTWEAR=Outwear
|
||||||
|
OTHERS=Others
|
||||||
BLOUSE=Blouse
|
BLOUSE=Blouse
|
||||||
DRESS=Dress
|
DRESS=Dress
|
||||||
TROUSERS=Trousers
|
TROUSERS=Trousers
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ OVERALL=Général
|
|||||||
TOPS=Hauts
|
TOPS=Hauts
|
||||||
BOTTOMS=Bas
|
BOTTOMS=Bas
|
||||||
OUTWEAR=Manteau
|
OUTWEAR=Manteau
|
||||||
|
OTHERS=Autres
|
||||||
BLOUSE=Chemisier
|
BLOUSE=Chemisier
|
||||||
DRESS=Robe
|
DRESS=Robe
|
||||||
TROUSERS=Pantalons
|
TROUSERS=Pantalons
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ OVERALL=Complessivo
|
|||||||
TOPS=Parte superiore
|
TOPS=Parte superiore
|
||||||
BOTTOMS=Parte inferiore
|
BOTTOMS=Parte inferiore
|
||||||
OUTWEAR=Capo esterno
|
OUTWEAR=Capo esterno
|
||||||
|
OTHERS=Altri
|
||||||
BLOUSE=Camicetta
|
BLOUSE=Camicetta
|
||||||
DRESS=Vestito
|
DRESS=Vestito
|
||||||
TROUSERS=Pantaloni
|
TROUSERS=Pantaloni
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ OVERALL=全体
|
|||||||
TOPS=トップス
|
TOPS=トップス
|
||||||
BOTTOMS=ボトムス
|
BOTTOMS=ボトムス
|
||||||
OUTWEAR=アウターウェア
|
OUTWEAR=アウターウェア
|
||||||
|
OTHERS=その他
|
||||||
BLOUSE=ブラウス
|
BLOUSE=ブラウス
|
||||||
DRESS=ドレス
|
DRESS=ドレス
|
||||||
TROUSERS=ズボン
|
TROUSERS=ズボン
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ OVERALL=전체
|
|||||||
TOPS=상의
|
TOPS=상의
|
||||||
BOTTOMS=하의
|
BOTTOMS=하의
|
||||||
OUTWEAR=외투
|
OUTWEAR=외투
|
||||||
|
OTHERS=기타
|
||||||
BLOUSE=블라우스
|
BLOUSE=블라우스
|
||||||
DRESS=드레스
|
DRESS=드레스
|
||||||
TROUSERS=바지
|
TROUSERS=바지
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ OVERALL=Общий
|
|||||||
TOPS=Топы
|
TOPS=Топы
|
||||||
BOTTOMS=Штаны
|
BOTTOMS=Штаны
|
||||||
OUTWEAR=Верхняя одежда
|
OUTWEAR=Верхняя одежда
|
||||||
|
OTHERS=ДРУГИЕ
|
||||||
BLOUSE=Блуза
|
BLOUSE=Блуза
|
||||||
DRESS=Платье
|
DRESS=Платье
|
||||||
TROUSERS=Брюки
|
TROUSERS=Брюки
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ OVERALL=โดยรวม
|
|||||||
TOPS=เสื้อ
|
TOPS=เสื้อ
|
||||||
BOTTOMS=กางเกง
|
BOTTOMS=กางเกง
|
||||||
OUTWEAR=เสื้อผ้านอก
|
OUTWEAR=เสื้อผ้านอก
|
||||||
|
OTHERS=อื่นๆ
|
||||||
BLOUSE=เสื้อผ้าผู้หญิง
|
BLOUSE=เสื้อผ้าผู้หญิง
|
||||||
DRESS=ชุดเดรส
|
DRESS=ชุดเดรส
|
||||||
TROUSERS=กางเกงขายาว
|
TROUSERS=กางเกงขายาว
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ OVERALL=Tổng thể
|
|||||||
TOPS=Áo đầu
|
TOPS=Áo đầu
|
||||||
BOTTOMS=Quần
|
BOTTOMS=Quần
|
||||||
OUTWEAR=Áo ngoại cỡ
|
OUTWEAR=Áo ngoại cỡ
|
||||||
|
OTHERS=KHÁC
|
||||||
BLOUSE=Áo sơ mi nữ
|
BLOUSE=Áo sơ mi nữ
|
||||||
DRESS=Váy
|
DRESS=Váy
|
||||||
TROUSERS=Quần dài
|
TROUSERS=Quần dài
|
||||||
|
|||||||
@@ -225,6 +225,7 @@ OVERALL=整体
|
|||||||
TOPS=上装
|
TOPS=上装
|
||||||
BOTTOMS=下装
|
BOTTOMS=下装
|
||||||
OUTWEAR=外套
|
OUTWEAR=外套
|
||||||
|
OTHERS=其他
|
||||||
BLOUSE=上衣
|
BLOUSE=上衣
|
||||||
DRESS=连衣裙
|
DRESS=连衣裙
|
||||||
TROUSERS=裤子
|
TROUSERS=裤子
|
||||||
|
|||||||
Reference in New Issue
Block a user