|
|
|
|
@@ -13,10 +13,7 @@ import com.ai.da.model.enums.Sex;
|
|
|
|
|
import com.ai.da.model.vo.ValidateElementVO;
|
|
|
|
|
import com.ai.da.python.PythonService;
|
|
|
|
|
import com.ai.da.python.vo.DesignPythonObjects;
|
|
|
|
|
import com.ai.da.service.CollectionElementService;
|
|
|
|
|
import com.ai.da.service.UserLikeGroupService;
|
|
|
|
|
import com.ai.da.service.UserLikeService;
|
|
|
|
|
import com.ai.da.service.WorkspaceService;
|
|
|
|
|
import com.ai.da.service.*;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
@@ -68,21 +65,24 @@ public class MyTaskScheduler {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void collectionSortData() {
|
|
|
|
|
// ToProductElement更新project_id字段数据
|
|
|
|
|
QueryWrapper<ToProductElement> toProductElementQueryWrapper = new QueryWrapper<>();
|
|
|
|
|
List<ToProductElement> toProductElements = toProductELementMapper.selectList(toProductElementQueryWrapper);
|
|
|
|
|
// for (ToProductElement toProductElement : toProductElements) {
|
|
|
|
|
// Long userLikeGroupId = toProductElement.getUserLikeGroupId();
|
|
|
|
|
// QueryWrapper<UserLikeGroup> userLikeGroupQueryWrapper = new QueryWrapper<>();
|
|
|
|
|
// userLikeGroupQueryWrapper.lambda().eq(UserLikeGroup::getId, userLikeGroupId);
|
|
|
|
|
// UserLikeGroup userLikeGroup = userLikeGroupMapper.selectOne(userLikeGroupQueryWrapper);
|
|
|
|
|
// ToProductElement更新project_id及type字段 不需要了
|
|
|
|
|
// QueryWrapper<ToProductImageResult> toProductImageResultQueryWrapper = new QueryWrapper<>();
|
|
|
|
|
// toProductImageResultQueryWrapper.lambda().eq(ToProductImageResult::getIsLike, 1);
|
|
|
|
|
// toProductImageResultQueryWrapper.lambda().eq(ToProductImageResult::getElementType, "ProductElement");
|
|
|
|
|
// List<ToProductImageResult> toProductImageResultList = toProductImageResultMapper.selectList(toProductImageResultQueryWrapper);
|
|
|
|
|
// for (ToProductImageResult toProductImageResult : toProductImageResultList) {
|
|
|
|
|
// Long elementId = toProductImageResult.getElementId();
|
|
|
|
|
// Long userLikeGroupId = toProductImageResult.getUserLikeGroupId();
|
|
|
|
|
// ToProductElement toProductElement = toProductELementMapper.selectById(elementId);
|
|
|
|
|
// UserLikeGroup userLikeGroup = userLikeGroupMapper.selectById(userLikeGroupId);
|
|
|
|
|
// if (Objects.nonNull(userLikeGroup)) {
|
|
|
|
|
// toProductElement.setProjectId(userLikeGroup.getProjectId());
|
|
|
|
|
// toProductElement.setType(CollectionType.DESIGN.getValue());
|
|
|
|
|
// collectionSortMapper.updateById(collectionSort);
|
|
|
|
|
// toProductElement.setType(toProductImageResult.getResultType());
|
|
|
|
|
// toProductELementMapper.updateById(toProductElement);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// collection_sort表数据添加
|
|
|
|
|
QueryWrapper<CollectionSort> qw = new QueryWrapper<>();
|
|
|
|
|
List<CollectionSort> collectionSortList = collectionSortMapper.selectList(qw);
|
|
|
|
|
for (CollectionSort collectionSort : collectionSortList) {
|
|
|
|
|
@@ -96,11 +96,39 @@ public class MyTaskScheduler {
|
|
|
|
|
collectionSort.setRelationType(CollectionType.DESIGN.getValue());
|
|
|
|
|
collectionSortMapper.updateById(collectionSort);
|
|
|
|
|
}
|
|
|
|
|
// 根据关联查询是否有相关的喜欢的toproduct及relight结果
|
|
|
|
|
UserLike userLike = userLikeMapper.selectById(collectionSort.getRelationId());
|
|
|
|
|
if (Objects.nonNull(userLike)) {
|
|
|
|
|
Long designOutfitId = userLike.getDesignOutfitId();
|
|
|
|
|
QueryWrapper<ToProductImageResult> toProductImageResultQueryWrapper1 = new QueryWrapper<>();
|
|
|
|
|
toProductImageResultQueryWrapper1.lambda().eq(ToProductImageResult::getElementId, designOutfitId);
|
|
|
|
|
toProductImageResultQueryWrapper1.lambda().eq(ToProductImageResult::getIsLike, 1);
|
|
|
|
|
List<ToProductImageResult> toProductImageResultList1 = toProductImageResultMapper.selectList(toProductImageResultQueryWrapper1);
|
|
|
|
|
if (!CollectionUtils.isEmpty(toProductImageResultList1)) {
|
|
|
|
|
for (ToProductImageResult toProductImageResult : toProductImageResultList1) {
|
|
|
|
|
designService.addCollectionSort(toProductImageResult.getId(), CollectionType.TO_PRODUCT_IMAGE.getValue(), collectionSort.getProjectId(), collectionSort.getId());
|
|
|
|
|
|
|
|
|
|
QueryWrapper<ToProductImageResult> relightResultQueryWrapper = new QueryWrapper<>();
|
|
|
|
|
relightResultQueryWrapper.lambda().eq(ToProductImageResult::getElementId, toProductImageResult.getId());
|
|
|
|
|
relightResultQueryWrapper.lambda().eq(ToProductImageResult::getIsLike, 1);
|
|
|
|
|
List<ToProductImageResult> toProductImageResultList2 = toProductImageResultMapper.selectList(relightResultQueryWrapper);
|
|
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(toProductImageResultList2)) {
|
|
|
|
|
for (ToProductImageResult relight : toProductImageResultList2) {
|
|
|
|
|
designService.addCollectionSort(relight.getId(), CollectionType.RELIGHT.getValue(), collectionSort.getProjectId(), collectionSort.getId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private CollectionSortMapper collectionSortMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private DesignService designService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private ToProductElementMapper toProductELementMapper;
|
|
|
|
|
|