BUGFIX:aida;
This commit is contained in:
@@ -49,6 +49,8 @@ public class SavedCollectionController {
|
|||||||
private MinioUtil minioUtil;
|
private MinioUtil minioUtil;
|
||||||
@Resource
|
@Resource
|
||||||
private ClassificationService classificationService;
|
private ClassificationService classificationService;
|
||||||
|
@Resource
|
||||||
|
private PortfolioService portfolioService;
|
||||||
|
|
||||||
@ApiOperation(value = "History用户分页分组列表")
|
@ApiOperation(value = "History用户分页分组列表")
|
||||||
@PostMapping("/queryUserGroup")
|
@PostMapping("/queryUserGroup")
|
||||||
@@ -122,6 +124,10 @@ public class SavedCollectionController {
|
|||||||
}
|
}
|
||||||
userLikeGroupVO.setGroupDetails(details);
|
userLikeGroupVO.setGroupDetails(details);
|
||||||
userLikeGroupVO.setSketchCount(CollectionUtils.isEmpty(details) ? 0 : details.size());
|
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 userLikeGroupVO;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -12,4 +12,5 @@ public class ToProductImageDTO {
|
|||||||
private List<ToProductImageVO> toProductImageVOList;
|
private List<ToProductImageVO> toProductImageVOList;
|
||||||
private String prompt;
|
private String prompt;
|
||||||
private BigDecimal imageStrength;
|
private BigDecimal imageStrength;
|
||||||
|
private String direction;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,4 +22,6 @@ public class MagicToolResultVO {
|
|||||||
private String category;
|
private String category;
|
||||||
|
|
||||||
private String sourceUrl;
|
private String sourceUrl;
|
||||||
|
|
||||||
|
private String resultType;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ public class UserLikeGroupVO {
|
|||||||
|
|
||||||
private Long originalAccountId;
|
private Long originalAccountId;
|
||||||
|
|
||||||
|
private Long originalPortfolioId;
|
||||||
|
|
||||||
@ApiModelProperty("更新时间")
|
@ApiModelProperty("更新时间")
|
||||||
private Long updateDate;
|
private Long updateDate;
|
||||||
|
|
||||||
@@ -35,4 +37,7 @@ public class UserLikeGroupVO {
|
|||||||
@ApiModelProperty("分组对应的详情 一次行带出来")
|
@ApiModelProperty("分组对应的详情 一次行带出来")
|
||||||
private List<UserLikeVO> groupDetails;
|
private List<UserLikeVO> groupDetails;
|
||||||
|
|
||||||
|
private String originalAccountName;
|
||||||
|
private String originalPortfolioName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3355,7 +3355,7 @@ public class PythonService {
|
|||||||
throw new BusinessException("toProductImage.interface.exception");
|
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 限流校验
|
// todo 限流校验
|
||||||
// AccessLimitUtils.validate("design",5);
|
// AccessLimitUtils.validate("design",5);
|
||||||
OkHttpClient client = new OkHttpClient().newBuilder()
|
OkHttpClient client = new OkHttpClient().newBuilder()
|
||||||
@@ -3370,6 +3370,7 @@ public class PythonService {
|
|||||||
map.put("tasks_id", taskId);
|
map.put("tasks_id", taskId);
|
||||||
map.put("image_url", url);
|
map.put("image_url", url);
|
||||||
map.put("prompt", prompt);
|
map.put("prompt", prompt);
|
||||||
|
map.put("direction", direction);
|
||||||
log.info("relightImage请求python 参数:####{}", map);
|
log.info("relightImage请求python 参数:####{}", map);
|
||||||
String param = JSON.toJSONString(map, SerializerFeature.WriteNullStringAsEmpty);
|
String param = JSON.toJSONString(map, SerializerFeature.WriteNullStringAsEmpty);
|
||||||
log.info(param);
|
log.info(param);
|
||||||
|
|||||||
@@ -103,17 +103,27 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
|||||||
@Resource
|
@Resource
|
||||||
private SysFileMapper sysFileMapper;
|
private SysFileMapper sysFileMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private LibraryMapper libraryMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private StyleMapper styleMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WorkspaceRelStyleMapper workspaceRelStyleMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean publish(MultipartFile file, String data) {
|
public Boolean publish(MultipartFile file, String data) {
|
||||||
|
AuthPrincipalVo authPrincipalVo = UserContext.getUserHolder();
|
||||||
PortfolioDTO portfolioDTO = JSONObject.parseObject(data, PortfolioDTO.class);
|
PortfolioDTO portfolioDTO = JSONObject.parseObject(data, PortfolioDTO.class);
|
||||||
QueryWrapper<Portfolio> existSameNameQw = new QueryWrapper<>();
|
QueryWrapper<Portfolio> existSameNameQw = new QueryWrapper<>();
|
||||||
existSameNameQw.lambda().eq(Portfolio::getPortfolioName, portfolioDTO.getPortfolioName());
|
existSameNameQw.lambda().eq(Portfolio::getPortfolioName, portfolioDTO.getPortfolioName());
|
||||||
|
existSameNameQw.lambda().eq(Portfolio::getAccountId, authPrincipalVo.getId());
|
||||||
List<Portfolio> portfoliosSameName = portfolioMapper.selectList(existSameNameQw);
|
List<Portfolio> portfoliosSameName = portfolioMapper.selectList(existSameNameQw);
|
||||||
if (!CollectionUtils.isEmpty(portfoliosSameName)) {
|
if (!CollectionUtils.isEmpty(portfoliosSameName)) {
|
||||||
throw new BusinessException("The title of the published work has been used.");
|
throw new BusinessException("The title of the published work has been used.");
|
||||||
}
|
}
|
||||||
AuthPrincipalVo authPrincipalVo = UserContext.getUserHolder();
|
|
||||||
if (file != null && file.getOriginalFilename() != null) {
|
if (file != null && file.getOriginalFilename() != null) {
|
||||||
String upload = minioUtil.upload("aida-canvas", String.valueOf(authPrincipalVo.getId()), file);
|
String upload = minioUtil.upload("aida-canvas", String.valueOf(authPrincipalVo.getId()), file);
|
||||||
Canvas canvas = new Canvas();
|
Canvas canvas = new Canvas();
|
||||||
@@ -128,11 +138,17 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
|||||||
userLikeGroupNew.setId(null);
|
userLikeGroupNew.setId(null);
|
||||||
userLikeGroupNew.setAccountId(-1L);
|
userLikeGroupNew.setAccountId(-1L);
|
||||||
Long collectionIdOld = userLikeGroup.getCollectionId();
|
Long collectionIdOld = userLikeGroup.getCollectionId();
|
||||||
|
QueryWrapper<Design> designQueryWrapper = new QueryWrapper<>();
|
||||||
|
designQueryWrapper.lambda().eq(Design::getCollectionId, collectionIdOld);
|
||||||
|
Design designOld = designMapper.selectOne(designQueryWrapper);
|
||||||
Collection collectionOld = collectionMapper.selectById(collectionIdOld);
|
Collection collectionOld = collectionMapper.selectById(collectionIdOld);
|
||||||
List<CollectionElement> collectionElementListOld = collectionElementService.getByCollectionId(collectionIdOld);
|
List<CollectionElement> collectionElementListOld = collectionElementService.getByCollectionId(collectionIdOld);
|
||||||
collectionOld.setId(null);
|
collectionOld.setId(null);
|
||||||
collectionMapper.insert(collectionOld);
|
collectionMapper.insert(collectionOld);
|
||||||
Long collectionIdNew = collectionOld.getId();
|
Long collectionIdNew = collectionOld.getId();
|
||||||
|
designOld.setCollectionId(collectionIdNew);
|
||||||
|
designOld.setId(null);
|
||||||
|
designMapper.insert(designOld);
|
||||||
userLikeGroupNew.setCollectionId(collectionIdNew);
|
userLikeGroupNew.setCollectionId(collectionIdNew);
|
||||||
userLikeGroupMapper.insert(userLikeGroupNew);
|
userLikeGroupMapper.insert(userLikeGroupNew);
|
||||||
for (CollectionElement element : collectionElementListOld) {
|
for (CollectionElement element : collectionElementListOld) {
|
||||||
@@ -179,17 +195,12 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<UserLike> userLikeList = userLikeService.getUserLikeList(portfolioDTO.getUserLikeGroupId());
|
List<UserLike> userLikeList = userLikeService.getUserLikeList(portfolioDTO.getUserLikeGroupId());
|
||||||
// Long coverIdNew = null;
|
|
||||||
// Boolean flag = false;
|
|
||||||
for (UserLike userLike : userLikeList) {
|
for (UserLike userLike : userLikeList) {
|
||||||
Long designOutfitIdOld = userLike.getDesignOutfitId();
|
Long designOutfitIdOld = userLike.getDesignOutfitId();
|
||||||
TDesignPythonOutfit designPythonOutfit = designPythonOutfitMapper.selectById(designOutfitIdOld);
|
TDesignPythonOutfit designPythonOutfit = designPythonOutfitMapper.selectById(designOutfitIdOld);
|
||||||
designPythonOutfit.setDesignId(-1L);
|
designPythonOutfit.setDesignId(-1L);
|
||||||
designPythonOutfit.setDesignItemId(-1L);
|
designPythonOutfit.setDesignItemId(-1L);
|
||||||
designPythonOutfit.setCollectionId(collectionIdNew);
|
designPythonOutfit.setCollectionId(collectionIdNew);
|
||||||
// if (designPythonOutfit.getId().equals(coverIdOld)) {
|
|
||||||
// flag = true;
|
|
||||||
// }
|
|
||||||
designPythonOutfit.setId(null);
|
designPythonOutfit.setId(null);
|
||||||
Long designItemIdOld = userLike.getDesignItemId();
|
Long designItemIdOld = userLike.getDesignItemId();
|
||||||
DesignItem designItemOld = designItemMapper.selectById(designItemIdOld);
|
DesignItem designItemOld = designItemMapper.selectById(designItemIdOld);
|
||||||
@@ -208,21 +219,12 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
|||||||
qw.lambda().eq(TDesignPythonOutfitDetail::getDesignPythonOutfitId, designOutfitIdOld);
|
qw.lambda().eq(TDesignPythonOutfitDetail::getDesignPythonOutfitId, designOutfitIdOld);
|
||||||
List<TDesignPythonOutfitDetail> tDesignPythonOutfitDetails = designPythonOutfitDetailMapper.selectList(qw);
|
List<TDesignPythonOutfitDetail> tDesignPythonOutfitDetails = designPythonOutfitDetailMapper.selectList(qw);
|
||||||
for (TDesignPythonOutfitDetail tDesignPythonOutfitDetail : tDesignPythonOutfitDetails) {
|
for (TDesignPythonOutfitDetail tDesignPythonOutfitDetail : tDesignPythonOutfitDetails) {
|
||||||
// Long designPythonOutfitDetailIdOld = tDesignPythonOutfitDetail.getId();
|
|
||||||
tDesignPythonOutfitDetail.setId(null);
|
tDesignPythonOutfitDetail.setId(null);
|
||||||
tDesignPythonOutfitDetail.setDesignId(-1L);
|
tDesignPythonOutfitDetail.setDesignId(-1L);
|
||||||
tDesignPythonOutfitDetail.setDesignPythonOutfitId(designOutfitIdNew);
|
tDesignPythonOutfitDetail.setDesignPythonOutfitId(designOutfitIdNew);
|
||||||
designPythonOutfitDetailMapper.insert(tDesignPythonOutfitDetail);
|
designPythonOutfitDetailMapper.insert(tDesignPythonOutfitDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (flag) {
|
|
||||||
// coverIdNew = designOutfitIdNew;
|
|
||||||
// portfolio.setCoverId(coverIdNew);
|
|
||||||
// portfolioMapper.updateById(portfolio);
|
|
||||||
// flag = false;
|
|
||||||
// }
|
|
||||||
// designPythonOutfitMapper.updateById(designPythonOutfit);
|
|
||||||
|
|
||||||
userLike.setDesignItemId(designItemIdNew);
|
userLike.setDesignItemId(designItemIdNew);
|
||||||
userLike.setId(null);
|
userLike.setId(null);
|
||||||
userLike.setDesignId(-1L);
|
userLike.setDesignId(-1L);
|
||||||
@@ -283,15 +285,16 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public PortfolioVO update(PortfolioDTO portfolioDTO) {
|
public PortfolioVO update(PortfolioDTO portfolioDTO) {
|
||||||
|
AuthPrincipalVo authPrincipalVo = UserContext.getUserHolder();
|
||||||
QueryWrapper<Portfolio> existSameNameQw = new QueryWrapper<>();
|
QueryWrapper<Portfolio> existSameNameQw = new QueryWrapper<>();
|
||||||
existSameNameQw.lambda().ne(Portfolio::getId, portfolioDTO.getId());
|
existSameNameQw.lambda().ne(Portfolio::getId, portfolioDTO.getId());
|
||||||
existSameNameQw.lambda().eq(Portfolio::getPortfolioName, portfolioDTO.getPortfolioName());
|
existSameNameQw.lambda().eq(Portfolio::getPortfolioName, portfolioDTO.getPortfolioName());
|
||||||
|
existSameNameQw.lambda().eq(Portfolio::getAccountId, authPrincipalVo.getId());
|
||||||
List<Portfolio> portfoliosSameName = portfolioMapper.selectList(existSameNameQw);
|
List<Portfolio> portfoliosSameName = portfolioMapper.selectList(existSameNameQw);
|
||||||
if (!CollectionUtils.isEmpty(portfoliosSameName)) {
|
if (!CollectionUtils.isEmpty(portfoliosSameName)) {
|
||||||
throw new BusinessException("The title of the published work has been used.");
|
throw new BusinessException("The title of the published work has been used.");
|
||||||
}
|
}
|
||||||
if (portfolioDTO.getPortfolioType().equals("History")) {
|
if (portfolioDTO.getPortfolioType().equals("History")) {
|
||||||
AuthPrincipalVo authPrincipalVo = UserContext.getUserHolder();
|
|
||||||
UserLikeGroup userLikeGroup = userLikeGroupMapper.selectById(portfolioDTO.getUserLikeGroupId());
|
UserLikeGroup userLikeGroup = userLikeGroupMapper.selectById(portfolioDTO.getUserLikeGroupId());
|
||||||
UserLikeGroup userLikeGroupNew = userLikeGroup.setId(null);
|
UserLikeGroup userLikeGroupNew = userLikeGroup.setId(null);
|
||||||
userLikeGroupNew.setAccountId(-1L);
|
userLikeGroupNew.setAccountId(-1L);
|
||||||
@@ -499,9 +502,9 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
|||||||
if (Objects.isNull(userLikeGroup)) {
|
if (Objects.isNull(userLikeGroup)) {
|
||||||
throw new BusinessException("");
|
throw new BusinessException("");
|
||||||
}
|
}
|
||||||
// UserLikeGroup userLikeGroup = userLikeGroupMapper.selectById();
|
|
||||||
UserLikeGroup userLikeGroupNew = CopyUtil.copyObject(userLikeGroup, UserLikeGroup.class);
|
UserLikeGroup userLikeGroupNew = CopyUtil.copyObject(userLikeGroup, UserLikeGroup.class);
|
||||||
userLikeGroupNew.setId(null);
|
userLikeGroupNew.setId(null);
|
||||||
|
userLikeGroupNew.setCreateDate(new Date());
|
||||||
if (portfolio.getOriginal() == 1) {
|
if (portfolio.getOriginal() == 1) {
|
||||||
if (Objects.equals(portfolio.getAccountId(), authPrincipalVo.getId())) {
|
if (Objects.equals(portfolio.getAccountId(), authPrincipalVo.getId())) {
|
||||||
userLikeGroupNew.setOriginal(0);
|
userLikeGroupNew.setOriginal(0);
|
||||||
@@ -546,7 +549,7 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
|||||||
designMapper.insert(design);
|
designMapper.insert(design);
|
||||||
|
|
||||||
userLikeGroupNew.setCollectionId(collectionIdNew);
|
userLikeGroupNew.setCollectionId(collectionIdNew);
|
||||||
userLikeGroupNew.setCreateDate(new Date());
|
userLikeGroupNew.setUpdateDate(new Date());
|
||||||
userLikeGroupMapper.insert(userLikeGroupNew);
|
userLikeGroupMapper.insert(userLikeGroupNew);
|
||||||
// List<TCollectionElementRelation> collectionElementRelationListNew = new ArrayList<>();
|
// List<TCollectionElementRelation> collectionElementRelationListNew = new ArrayList<>();
|
||||||
for (CollectionElement element : collectionElementListOld) {
|
for (CollectionElement element : collectionElementListOld) {
|
||||||
@@ -638,34 +641,101 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
|||||||
if (!CollectionUtils.isEmpty(workspaces)) {
|
if (!CollectionUtils.isEmpty(workspaces)) {
|
||||||
Workspace workspace1 = workspaces.get(0);
|
Workspace workspace1 = workspaces.get(0);
|
||||||
workspace1.setIsLastIndex(0);
|
workspace1.setIsLastIndex(0);
|
||||||
|
workspaceMapper.updateById(workspace1);
|
||||||
Workspace workspaceNew = new Workspace();
|
Workspace workspaceNew = new Workspace();
|
||||||
workspaceNew.setWorkSpaceName("workspace of " + portfolio.getPortfolioName());
|
workspaceNew.setWorkSpaceName("workspace of " + portfolio.getPortfolioName());
|
||||||
workspaceNew.setAccountId(accountId);
|
workspaceNew.setAccountId(accountId);
|
||||||
workspaceNew.setIsDeleted(0);
|
workspaceNew.setIsDeleted(0);
|
||||||
workspaceNew.setIsLastIndex(1);
|
workspaceNew.setIsLastIndex(1);
|
||||||
|
workspaceNew.setCreateTime(LocalDateTime.now());
|
||||||
|
workspaceNew.setSystemDesignerPercentage((design1.getSystemScale().multiply(BigDecimal.valueOf(100)).intValue()));
|
||||||
|
if (design1.getSingleOverall().equals("overall")) {
|
||||||
|
workspaceNew.setPosition("Overall");
|
||||||
|
}else {
|
||||||
|
workspaceNew.setPosition(design1.getSwitchCategory());
|
||||||
|
}
|
||||||
|
workspaceMapper.insert(workspaceNew);
|
||||||
if (design1.getModelType().equals("System")) {
|
if (design1.getModelType().equals("System")) {
|
||||||
SysFile sysFile = sysFileMapper.selectById(design1.getTemplateId());
|
SysFile sysFile = sysFileMapper.selectById(design1.getTemplateId());
|
||||||
if (sysFile.getLevel2Type().equals("Female")) {
|
if (sysFile.getLevel2Type().equals("Female")) {
|
||||||
workspaceNew.setSex("Female");
|
workspaceNew.setSex("Female");
|
||||||
workspaceNew.setMannequinFemaleId(design1.getTemplateId());
|
workspaceNew.setMannequinFemaleId(design1.getTemplateId());
|
||||||
|
workspaceNew.setMannequinFemaleType("System");
|
||||||
QueryWrapper<SysFile> getAnotherOneQw = new QueryWrapper<>();
|
QueryWrapper<SysFile> 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<Style> styleQueryWrapper = new QueryWrapper<>();
|
||||||
|
styleQueryWrapper.lambda().eq(Style::getName, sysFile.getLevel3Type());
|
||||||
|
Style style = styleMapper.selectOne(styleQueryWrapper);
|
||||||
|
WorkspaceRelStyle workspaceRelStyle = new WorkspaceRelStyle();
|
||||||
|
workspaceRelStyle.setStyleId(style.getId());
|
||||||
|
workspaceRelStyle.setWorkspaceId(workspaceNew.getId());
|
||||||
|
workspaceRelStyleMapper.insert(workspaceRelStyle);
|
||||||
|
}
|
||||||
|
List<SysFile> anotherList = sysFileMapper.selectList(getAnotherOneQw);
|
||||||
|
if (!CollectionUtils.isEmpty(anotherList)) {
|
||||||
|
SysFile anotherOne = anotherList.get(0);
|
||||||
|
workspaceNew.setMannequinMaleId(anotherOne.getId());
|
||||||
|
workspaceNew.setMannequinMaleType("System");
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
workspaceNew.setSex("Male");
|
workspaceNew.setSex("Male");
|
||||||
workspaceNew.setMannequinMaleId(design1.getTemplateId());
|
workspaceNew.setMannequinMaleId(design1.getTemplateId());
|
||||||
|
workspaceNew.setMannequinMaleType("System");
|
||||||
|
QueryWrapper<SysFile> getAnotherOneQw = new QueryWrapper<>();
|
||||||
|
getAnotherOneQw.lambda().eq(SysFile::getLevel1Type, "Models");
|
||||||
|
getAnotherOneQw.lambda().eq(SysFile::getLevel2Type, "Female");
|
||||||
|
if (!StringUtils.isEmpty(sysFile.getLevel3Type())) {
|
||||||
|
getAnotherOneQw.lambda().eq(SysFile::getLevel3Type, sysFile.getLevel3Type());
|
||||||
|
QueryWrapper<Style> styleQueryWrapper = new QueryWrapper<>();
|
||||||
|
styleQueryWrapper.lambda().eq(Style::getName, sysFile.getLevel3Type());
|
||||||
|
Style style = styleMapper.selectOne(styleQueryWrapper);
|
||||||
|
WorkspaceRelStyle workspaceRelStyle = new WorkspaceRelStyle();
|
||||||
|
workspaceRelStyle.setStyleId(style.getId());
|
||||||
|
workspaceRelStyle.setWorkspaceId(workspaceNew.getId());
|
||||||
|
workspaceRelStyleMapper.insert(workspaceRelStyle);
|
||||||
|
}
|
||||||
|
List<SysFile> anotherList = sysFileMapper.selectList(getAnotherOneQw);
|
||||||
|
if (!CollectionUtils.isEmpty(anotherList)) {
|
||||||
|
SysFile anotherOne = anotherList.get(0);
|
||||||
|
workspaceNew.setMannequinFemaleId(anotherOne.getId());
|
||||||
|
workspaceNew.setMannequinFemaleType("System");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (design1.getSingleOverall().equals("overall")) {
|
}else {
|
||||||
workspaceNew.setPosition("Overall");
|
Library library = libraryMapper.selectById(design1.getTemplateId());
|
||||||
|
if (library.getLevel2Type().equals("Female")) {
|
||||||
|
workspaceNew.setSex("Female");
|
||||||
|
workspaceNew.setMannequinFemaleId(design1.getTemplateId());
|
||||||
|
workspaceNew.setMannequinFemaleType("Library");
|
||||||
|
QueryWrapper<SysFile> getAnotherOneQw = new QueryWrapper<>();
|
||||||
|
getAnotherOneQw.lambda().eq(SysFile::getLevel1Type, "Models");
|
||||||
|
getAnotherOneQw.lambda().eq(SysFile::getLevel2Type, "Male");
|
||||||
|
List<SysFile> anotherList = sysFileMapper.selectList(getAnotherOneQw);
|
||||||
|
if (!CollectionUtils.isEmpty(anotherList)) {
|
||||||
|
SysFile anotherOne = anotherList.get(0);
|
||||||
|
workspaceNew.setMannequinMaleId(anotherOne.getId());
|
||||||
|
workspaceNew.setMannequinMaleType("System");
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
workspaceNew.setPosition(design1.getSwitchCategory());
|
workspaceNew.setSex("Male");
|
||||||
|
workspaceNew.setMannequinMaleId(design1.getTemplateId());
|
||||||
|
workspaceNew.setMannequinMaleType("Library");
|
||||||
|
QueryWrapper<SysFile> getAnotherOneQw = new QueryWrapper<>();
|
||||||
|
getAnotherOneQw.lambda().eq(SysFile::getLevel1Type, "Models");
|
||||||
|
getAnotherOneQw.lambda().eq(SysFile::getLevel2Type, "Female");
|
||||||
|
List<SysFile> anotherList = sysFileMapper.selectList(getAnotherOneQw);
|
||||||
|
if (!CollectionUtils.isEmpty(anotherList)) {
|
||||||
|
SysFile anotherOne = anotherList.get(0);
|
||||||
|
workspaceNew.setMannequinFemaleId(anotherOne.getId());
|
||||||
|
workspaceNew.setMannequinFemaleType("System");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
workspaceNew.setSex();
|
workspaceMapper.updateById(workspaceNew);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return userLikeGroupService.choose(userLikeGroupNew.getId());
|
return userLikeGroupService.choose(userLikeGroupNew.getId());
|
||||||
|
|||||||
@@ -355,6 +355,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
|||||||
if (Objects.isNull(toProductImageResult)) {
|
if (Objects.isNull(toProductImageResult)) {
|
||||||
throw new BusinessException("The source image does not exist.");
|
throw new BusinessException("The source image does not exist.");
|
||||||
}
|
}
|
||||||
|
magicToolResultVO.setResultType(toProductImageResult.getResultType());
|
||||||
if (toProductImageResult.getElementType().equals("ProductElement")) {
|
if (toProductImageResult.getElementType().equals("ProductElement")) {
|
||||||
ToProductElement toProductElement = toProductElementMapper.selectById(toProductImageResult.getElementId());
|
ToProductElement toProductElement = toProductElementMapper.selectById(toProductImageResult.getElementId());
|
||||||
magicToolResultVO.setSourceUrl(minioUtil.getPresignedUrl(toProductElement.getUrl(), 24 * 60));
|
magicToolResultVO.setSourceUrl(minioUtil.getPresignedUrl(toProductElement.getUrl(), 24 * 60));
|
||||||
@@ -479,7 +480,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
|||||||
i ++;
|
i ++;
|
||||||
ToProductImageResult toProductImageResult1 = toProductImageResultMapper.selectById(toProductImageVO.getElementId());
|
ToProductImageResult toProductImageResult1 = toProductImageResultMapper.selectById(toProductImageVO.getElementId());
|
||||||
// 走模型
|
// 走模型
|
||||||
pythonService.relight(toProductImageResult1.getUrl(), taskId, s);
|
pythonService.relight(toProductImageResult1.getUrl(), taskId, s, toProductImageDTO.getDirection());
|
||||||
ToProductImageResult toProductImageResult = new ToProductImageResult();
|
ToProductImageResult toProductImageResult = new ToProductImageResult();
|
||||||
toProductImageResult.setElementId(toProductImageResult1.getId());
|
toProductImageResult.setElementId(toProductImageResult1.getId());
|
||||||
toProductImageResult.setElementType("ToProductImage");
|
toProductImageResult.setElementType("ToProductImage");
|
||||||
@@ -496,7 +497,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
|||||||
String taskId = UUID.randomUUID() + "-" + i + "-" + userHolder.getId();
|
String taskId = UUID.randomUUID() + "-" + i + "-" + userHolder.getId();
|
||||||
ToProductElement toProductElement = toProductElementMapper.selectById(toProductImageVO.getElementId());
|
ToProductElement toProductElement = toProductElementMapper.selectById(toProductImageVO.getElementId());
|
||||||
// 走模型
|
// 走模型
|
||||||
pythonService.relight(toProductElement.getUrl(), taskId, s);
|
pythonService.relight(toProductElement.getUrl(), taskId, s, toProductImageDTO.getDirection());
|
||||||
ToProductImageResult toProductImageResult = new ToProductImageResult();
|
ToProductImageResult toProductImageResult = new ToProductImageResult();
|
||||||
toProductImageResult.setElementId(toProductElement.getId());
|
toProductImageResult.setElementId(toProductElement.getId());
|
||||||
toProductImageResult.setElementType("ProductElement");
|
toProductImageResult.setElementType("ProductElement");
|
||||||
@@ -533,6 +534,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
|||||||
if (Objects.isNull(toProductImageResult)) {
|
if (Objects.isNull(toProductImageResult)) {
|
||||||
throw new BusinessException("The source image does not exist.");
|
throw new BusinessException("The source image does not exist.");
|
||||||
}
|
}
|
||||||
|
magicToolResultVO.setResultType(toProductImageResult.getResultType());
|
||||||
if (toProductImageResult.getElementType().equals("ProductElement")) {
|
if (toProductImageResult.getElementType().equals("ProductElement")) {
|
||||||
ToProductElement toProductElement = toProductElementMapper.selectById(toProductImageResult.getElementId());
|
ToProductElement toProductElement = toProductElementMapper.selectById(toProductImageResult.getElementId());
|
||||||
magicToolResultVO.setSourceUrl(minioUtil.getPresignedUrl(toProductElement.getUrl(), 24 * 60));
|
magicToolResultVO.setSourceUrl(minioUtil.getPresignedUrl(toProductElement.getUrl(), 24 * 60));
|
||||||
|
|||||||
Reference in New Issue
Block a user