bugfix: delete collection;
This commit is contained in:
@@ -387,6 +387,16 @@ public class GenerateConsumer {
|
||||
String taskId = generateResult.getString("task_id");
|
||||
userLikeGroupService.toProductBatch(taskId, url, progress);
|
||||
}
|
||||
} else if (progress.startsWith("0/")) {
|
||||
String batchTaskId = generateResult.getString("task_id");
|
||||
if (!StringUtils.isEmpty(batchTaskId)) {
|
||||
userLikeGroupService.startTask(batchTaskId);
|
||||
}
|
||||
} else if (progress.equals("OK")) {
|
||||
String batchTaskId = generateResult.getString("task_id");
|
||||
if (!StringUtils.isEmpty(batchTaskId)) {
|
||||
userLikeGroupService.completeTask(batchTaskId);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 修改redis中的数据状态为exception
|
||||
@@ -440,6 +450,16 @@ public class GenerateConsumer {
|
||||
String taskId = generateResult.getString("task_id");
|
||||
userLikeGroupService.relightBatch(taskId, url, progress);
|
||||
}
|
||||
} else if (progress.startsWith("0/")) {
|
||||
String batchTaskId = generateResult.getString("task_id");
|
||||
if (!StringUtils.isEmpty(batchTaskId)) {
|
||||
userLikeGroupService.startTask(batchTaskId);
|
||||
}
|
||||
} else if (progress.equals("OK")) {
|
||||
String batchTaskId = generateResult.getString("task_id");
|
||||
if (!StringUtils.isEmpty(batchTaskId)) {
|
||||
userLikeGroupService.completeTask(batchTaskId);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 修改redis中的数据状态为exception
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ai.da.common.config;
|
||||
|
||||
import com.ai.da.common.enums.CollectionLevel1TypeEnum;
|
||||
import com.ai.da.common.utils.*;
|
||||
import com.ai.da.mapper.primary.*;
|
||||
import com.ai.da.mapper.primary.entity.*;
|
||||
@@ -8,6 +9,7 @@ import com.ai.da.mapper.secondary.AttributeRetrievalMapper;
|
||||
import com.ai.da.model.dto.*;
|
||||
import com.ai.da.model.enums.CollectionType;
|
||||
import com.ai.da.model.enums.DesignProcess;
|
||||
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;
|
||||
@@ -24,6 +26,7 @@ import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@@ -65,8 +68,22 @@ public class MyTaskScheduler {
|
||||
}
|
||||
|
||||
private void collectionSortData() {
|
||||
QueryWrapper<CollectionSort> qw = new QueryWrapper<>();
|
||||
// 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);
|
||||
// if (Objects.nonNull(userLikeGroup)) {
|
||||
// toProductElement.setProjectId(userLikeGroup.getProjectId());
|
||||
// toProductElement.setType(CollectionType.DESIGN.getValue());
|
||||
// collectionSortMapper.updateById(collectionSort);
|
||||
// }
|
||||
// }
|
||||
|
||||
QueryWrapper<CollectionSort> qw = new QueryWrapper<>();
|
||||
List<CollectionSort> collectionSortList = collectionSortMapper.selectList(qw);
|
||||
for (CollectionSort collectionSort : collectionSortList) {
|
||||
Long userLikeGroupId = collectionSort.getUserLikeGroupId();
|
||||
@@ -84,6 +101,9 @@ public class MyTaskScheduler {
|
||||
|
||||
@Resource
|
||||
private CollectionSortMapper collectionSortMapper;
|
||||
|
||||
@Resource
|
||||
private ToProductElementMapper toProductELementMapper;
|
||||
|
||||
@Resource
|
||||
private AccountMapper accountMapper;
|
||||
@@ -681,6 +701,8 @@ public class MyTaskScheduler {
|
||||
|
||||
@Resource
|
||||
private CollectionElementMapper collectionElementMapper;
|
||||
@Resource
|
||||
private CollectionElementRelModelMapper collectionElementRelModelMapper;
|
||||
|
||||
@Resource
|
||||
private CollectionElementService collectionElementService;
|
||||
@@ -1367,7 +1389,7 @@ public class MyTaskScheduler {
|
||||
|
||||
@Transactional
|
||||
public void projectDataCreate() {
|
||||
// TODO:UserLikeGroup转project待完善
|
||||
// UserLikeGroup转project
|
||||
// QueryWrapper<UserLikeGroup> qw = new QueryWrapper<>();
|
||||
// qw.lambda().ne(UserLikeGroup::getAccountId, -1);
|
||||
// List<UserLikeGroup> userLikeGroups = userLikeGroupMapper.selectList(qw);
|
||||
@@ -1409,6 +1431,7 @@ public class MyTaskScheduler {
|
||||
// if (!design.getSingleOverall().equals("overall")) {
|
||||
// workspace.setPosition(design.getSwitchCategory());
|
||||
// }
|
||||
//
|
||||
// workspace.setId(null);
|
||||
// workspaceMapper.insert(workspace);
|
||||
//
|
||||
@@ -1426,10 +1449,52 @@ public class MyTaskScheduler {
|
||||
// collectionElement.setIsCompositeImage(1);
|
||||
// collectionElementMapper.updateById(collectionElement);
|
||||
// }
|
||||
//
|
||||
// if (design.getModelType().equals("System")) {
|
||||
// SysFile sysFile = sysFileMapper.selectById(design.getTemplateId());
|
||||
//
|
||||
// CollectionElement collectionElement = new CollectionElement();
|
||||
// collectionElement.setAccountId(design.getAccountId());
|
||||
// collectionElement.setProjectId(project.getId());
|
||||
// collectionElement.setLevel1Type(CollectionLevel1TypeEnum.MODEL.getRealName());
|
||||
//// collectionElement.setLevel2Type(board.getLevel2Type());
|
||||
// collectionElement.setName(sysFile.getName());
|
||||
// collectionElement.setUrl(sysFile.getUrl());
|
||||
//// collectionElement.setHasPin(board.getIsPin());
|
||||
// collectionElement.setMd5(sysFile.getMd5());
|
||||
// collectionElement.setCreateDate(new Date());
|
||||
// collectionElement.setHasPin((byte) 0);
|
||||
// collectionElementMapper.insert(collectionElement);
|
||||
// CollectionElementRelModel collectionElementRelModel = new CollectionElementRelModel();
|
||||
// collectionElementRelModel.setCollectionElementId(collectionElement.getId());
|
||||
// collectionElementRelModel.setRelationId(sysFile.getId());
|
||||
// collectionElementRelModel.setRelationType("System");
|
||||
// collectionElementRelModelMapper.insert(collectionElementRelModel);
|
||||
// }else {
|
||||
// Library library = libraryMapper.selectById(design.getTemplateId());
|
||||
// CollectionElement collectionElement = new CollectionElement();
|
||||
// collectionElement.setAccountId(design.getAccountId());
|
||||
// collectionElement.setProjectId(project.getId());
|
||||
// collectionElement.setLevel1Type(CollectionLevel1TypeEnum.MODEL.getRealName());
|
||||
//// collectionElement.setLevel2Type(board.getLevel2Type());
|
||||
// collectionElement.setName(library.getName());
|
||||
// collectionElement.setUrl(library.getUrl());
|
||||
//// collectionElement.setHasPin(board.getIsPin());
|
||||
// collectionElement.setMd5(library.getMd5());
|
||||
// collectionElement.setCreateDate(new Date());
|
||||
// collectionElement.setHasPin((byte) 0);
|
||||
// collectionElementMapper.insert(collectionElement);
|
||||
// CollectionElementRelModel collectionElementRelModel = new CollectionElementRelModel();
|
||||
// collectionElementRelModel.setCollectionElementId(collectionElement.getId());
|
||||
// collectionElementRelModel.setRelationId(library.getId());
|
||||
// collectionElementRelModel.setRelationType("Library");
|
||||
// collectionElementRelModelMapper.insert(collectionElementRelModel);
|
||||
// }
|
||||
//
|
||||
// userLikeGroup.setProjectId(project.getId());
|
||||
// userLikeGroupMapper.updateById(userLikeGroup);
|
||||
// }
|
||||
// // toProductImage relight数据
|
||||
// // 必须先完成project数据新增后再执行 toProductImage relight数据关联project
|
||||
// QueryWrapper<Project> projectQueryWrapper = new QueryWrapper<>();
|
||||
// List<Project> projects = projectMapper.selectList(projectQueryWrapper);
|
||||
// for (Project project : projects) {
|
||||
@@ -1455,8 +1520,8 @@ public class MyTaskScheduler {
|
||||
// }
|
||||
// // 画布数据
|
||||
// QueryWrapper<ExportFile> exportFileQueryWrapper = new QueryWrapper<>();
|
||||
// exportFileQueryWrapper.lambda().ge(ExportFile::getId, 10);
|
||||
// exportFileQueryWrapper.lambda().le(ExportFile::getId, 86);
|
||||
//// exportFileQueryWrapper.lambda().ge(ExportFile::getId, 10);
|
||||
//// exportFileQueryWrapper.lambda().le(ExportFile::getId, 86);
|
||||
// List<ExportFile> exportFiles = exportFileMapper.selectList(exportFileQueryWrapper);
|
||||
// for (ExportFile exportFile : exportFiles) {
|
||||
// Long userLikeGroupId = exportFile.getProjectId();
|
||||
@@ -1467,7 +1532,23 @@ public class MyTaskScheduler {
|
||||
// }
|
||||
// }
|
||||
|
||||
// TODO:作品关联数据转json数据
|
||||
// 作品关联数据转json数据
|
||||
// 作品关联projectId
|
||||
QueryWrapper<Portfolio> updateQueryWrapper = new QueryWrapper<>();
|
||||
updateQueryWrapper.lambda().eq(Portfolio::getOpenSource, 1);
|
||||
List<Portfolio> portfolioListUpdate = portfolioMapper.selectList(updateQueryWrapper);
|
||||
for (Portfolio portfolio : portfolioListUpdate) {
|
||||
Long userLikeGroupSourceId = portfolio.getUserLikeGroupSourceId();
|
||||
UserLikeGroup userLikeGroup = userLikeGroupMapper.selectById(userLikeGroupSourceId);
|
||||
if (Objects.nonNull(userLikeGroup)) {
|
||||
portfolio.setProjectId(userLikeGroup.getProjectId());
|
||||
portfolioMapper.updateById(portfolio);
|
||||
}else {
|
||||
// TODO:考虑关闭二创
|
||||
portfolio.setOpenSource(0);
|
||||
portfolioMapper.updateById(portfolio);
|
||||
}
|
||||
}
|
||||
// 查询作品
|
||||
QueryWrapper<Portfolio> portfolioQueryWrapper = new QueryWrapper<>();
|
||||
portfolioQueryWrapper.lambda().eq(Portfolio::getOpenSource, 1);
|
||||
|
||||
Reference in New Issue
Block a user