TASK:模块化;
This commit is contained in:
@@ -291,7 +291,7 @@ public class SavedCollectionController {
|
||||
|
||||
@ApiOperation(value = "brandDNAUpload")
|
||||
@PostMapping("/brandDNAUpload")
|
||||
public Response<Library> brandDNAUpload(@RequestParam("file") MultipartFile file, @RequestParam("brandId") Long brandId) throws IOException {
|
||||
public Response<LibraryUpdateVo> brandDNAUpload(@RequestParam("file") MultipartFile file, @RequestParam("brandId") Long brandId) throws IOException {
|
||||
return Response.success(userLikeGroupService.brandDNAUpload(file, brandId));
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ public class Portfolio implements Serializable {
|
||||
@ApiModelProperty(value = "collection ID")
|
||||
private Long collectionId;
|
||||
|
||||
private Long projectId;
|
||||
|
||||
@ApiModelProperty(value = "userLikeGroup源")
|
||||
private Long userLikeGroupSourceId;
|
||||
|
||||
|
||||
@@ -29,6 +29,12 @@ public class Project implements Serializable {
|
||||
|
||||
private String process;
|
||||
|
||||
private Integer original;
|
||||
|
||||
private Long originalAccountId;
|
||||
|
||||
private Long originalPortfolioId;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@@ -9,4 +9,6 @@ public class PortfolioDTO extends Portfolio {
|
||||
private Long userLikeGroupId;
|
||||
|
||||
private List<TagsDTO> tagsDTO;
|
||||
|
||||
private Long projectId;
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@ import java.util.List;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ThreeDLayoutQueryDTO extends PageQueryBaseVo {
|
||||
|
||||
private String sex;
|
||||
}
|
||||
|
||||
@@ -15,21 +15,6 @@ public class ProjectChooseVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
// @ApiModelProperty("分组id")
|
||||
// private Long userGroupId;
|
||||
//
|
||||
// @ApiModelProperty("分组详细数组")
|
||||
// private List<UserLikeVO> userLikeDetails;
|
||||
//
|
||||
// @ApiModelProperty("关联的collection")
|
||||
// private UserLikeCollectionVO collection;
|
||||
//
|
||||
// private String sex;
|
||||
//
|
||||
// private Integer beenPublished;
|
||||
//
|
||||
//// private Portfolio portfolio;
|
||||
// private PortfolioDTO portfolioDTO;
|
||||
private String name;
|
||||
|
||||
private WorkspaceVO workspaceVO;
|
||||
@@ -37,4 +22,8 @@ public class ProjectChooseVO {
|
||||
private String process;
|
||||
|
||||
private Long collectionId;
|
||||
|
||||
private Integer beenPublished;
|
||||
|
||||
private PortfolioDTO portfolioDTO;
|
||||
}
|
||||
|
||||
@@ -136,4 +136,5 @@ public interface CollectionElementService extends IService<CollectionElement> {
|
||||
*/
|
||||
CollectionElement editLevel2Type(Long elementId, String level2Type, String designType);
|
||||
|
||||
List<CollectionElement> getByProjectId(Long projectId);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public interface UserLikeGroupService extends IService<UserLikeGroup> {
|
||||
|
||||
Boolean brandDNASaveOrUpdate(BrandDNADTO brandDNADTO);
|
||||
|
||||
Library brandDNAUpload(MultipartFile file, Long brandId) throws IOException;
|
||||
LibraryUpdateVo brandDNAUpload(MultipartFile file, Long brandId) throws IOException;
|
||||
|
||||
PageBaseResponse<BrandDNAVO> brandDNAPage(BrandDNAQueryDTO brandDNAQueryDTO);
|
||||
|
||||
|
||||
@@ -913,6 +913,17 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
||||
return collectionElement;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CollectionElement> getByProjectId(Long projectId) {
|
||||
QueryWrapper<CollectionElement> qw = new QueryWrapper<>();
|
||||
qw.lambda().eq(CollectionElement::getProjectId, projectId);
|
||||
List<CollectionElement> collectionElementList = collectionElementMapper.selectList(qw);
|
||||
if (CollectionUtils.isEmpty(collectionElementList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return collectionElementList;
|
||||
}
|
||||
|
||||
private Generate setGenerate(Long userId,String timeZone){
|
||||
Generate generate = new Generate();
|
||||
generate.setAccountId(userId);
|
||||
|
||||
@@ -155,181 +155,161 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
||||
canvas.setAccountId(authPrincipalVo.getId());
|
||||
canvasMapper.insert(canvas);
|
||||
|
||||
Portfolio portfolio = new Portfolio();
|
||||
QueryWrapper<Portfolio> portfolioQueryWrapper = new QueryWrapper<>();
|
||||
portfolioQueryWrapper.lambda().eq(Portfolio::getProjectId, portfolioDTO.getProjectId());
|
||||
List<Portfolio> portfolioList = portfolioMapper.selectList(portfolioQueryWrapper);
|
||||
if (!CollectionUtils.isEmpty(portfolioList)) {
|
||||
portfolio = portfolioList.get(0);
|
||||
}
|
||||
Long projectId = portfolioDTO.getProjectId();
|
||||
Project project = projectMapper.selectById(projectId);
|
||||
if (project.getOriginal() == 0) {
|
||||
portfolio.setOriginal(0);
|
||||
portfolio.setOriginalAccountId(project.getOriginalAccountId());
|
||||
// TODO
|
||||
portfolio.setOriginalPortfolioId(project.getOriginalPortfolioId());
|
||||
} else {
|
||||
portfolio.setOriginal(1);
|
||||
}
|
||||
portfolio.setPortfolioName(portfolioDTO.getPortfolioName());
|
||||
portfolio.setAccountId(authPrincipalVo.getId());
|
||||
portfolio.setCreateDate(LocalDateTime.now());
|
||||
portfolio.setUpdateDate(LocalDateTime.now());
|
||||
portfolio.setStatus(1);
|
||||
portfolio.setIsDeleted(0);
|
||||
portfolio.setUserLikeGroupSourceId(portfolioDTO.getUserLikeGroupId());
|
||||
portfolio.setCanvasId(canvas.getId());
|
||||
portfolio.setPortfolioDes(portfolioDTO.getPortfolioDes());
|
||||
|
||||
Long workspaceId = workspaceService.getByProjectId(project.getId());
|
||||
Workspace workspace = workspaceMapper.selectById(workspaceId);
|
||||
|
||||
project.setId(null);
|
||||
project.setAccountId(-1L);
|
||||
project.setCreateTime(LocalDateTime.now());
|
||||
projectMapper.insert(project);
|
||||
Long projectIdCopy = project.getId();
|
||||
|
||||
workspace.setProjectId(projectIdCopy);
|
||||
workspace.setAccountId(-1L);
|
||||
workspaceMapper.insert(workspace);
|
||||
|
||||
if (portfolioDTO.getOpenSource() == 1) {
|
||||
UserLikeGroup userLikeGroup = userLikeGroupMapper.selectById(portfolioDTO.getUserLikeGroupId());
|
||||
portfolio.setPortfolioType("History");
|
||||
portfolio.setOpenSource(1);
|
||||
|
||||
Long projectId = userLikeGroup.getProjectId();
|
||||
Project project = projectMapper.selectById(projectId);
|
||||
|
||||
Long workspaceServiceByProjectId = workspaceService.getByProjectId(project.getId());
|
||||
Workspace workspace = workspaceMapper.selectById(workspaceServiceByProjectId);
|
||||
|
||||
project.setId(null);
|
||||
project.setAccountId(-1L);
|
||||
project.setCreateTime(LocalDateTime.now());
|
||||
projectMapper.insert(project);
|
||||
|
||||
workspace.setProjectId(project.getId());
|
||||
workspace.setAccountId(-1L);
|
||||
workspaceMapper.insert(workspace);
|
||||
|
||||
UserLikeGroup userLikeGroupNew = CopyUtil.copyObject(userLikeGroup, UserLikeGroup.class);
|
||||
userLikeGroupNew.setId(null);
|
||||
userLikeGroupNew.setAccountId(-1L);
|
||||
userLikeGroupNew.setProjectId(project.getId());
|
||||
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);
|
||||
List<CollectionElement> 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);
|
||||
List<CollectionElement> collectionElementListOld = collectionElementService.getByProjectId(projectId);
|
||||
for (CollectionElement element : collectionElementListOld) {
|
||||
element.setCollectionId(collectionIdNew);
|
||||
element.setProjectId(project.getId());
|
||||
element.setProjectId(projectIdCopy);
|
||||
element.setId(null);
|
||||
collectionElementMapper.insert(element);
|
||||
TCollectionElementRelation collectionElementRelationNew = new TCollectionElementRelation();
|
||||
collectionElementRelationNew.setCollectionId(collectionIdNew);
|
||||
collectionElementRelationNew.setElementId(element.getId());
|
||||
collectionElementRelationNew.setCreateDate(new Date());
|
||||
collectionElementRelationMapper.insert(collectionElementRelationNew);
|
||||
}
|
||||
Portfolio portfolio = new Portfolio();
|
||||
QueryWrapper<Portfolio> portfolioQueryWrapper = new QueryWrapper<>();
|
||||
portfolioQueryWrapper.lambda().eq(Portfolio::getUserLikeGroupSourceId, portfolioDTO.getUserLikeGroupId());
|
||||
List<Portfolio> portfolios = portfolioMapper.selectList(portfolioQueryWrapper);
|
||||
if (!CollectionUtils.isEmpty(portfolios)) {
|
||||
portfolio = portfolios.get(0);
|
||||
}
|
||||
if (userLikeGroup.getOriginal() == 0) {
|
||||
portfolio.setOriginal(0);
|
||||
portfolio.setOriginalAccountId(userLikeGroup.getOriginalAccountId());
|
||||
portfolio.setOriginalPortfolioId(userLikeGroup.getOriginalPortfolioId());
|
||||
} else {
|
||||
portfolio.setOriginal(1);
|
||||
// portfolio.setOriginalAccountId(authPrincipalVo.getId());
|
||||
}
|
||||
portfolio.setPortfolioName(portfolioDTO.getPortfolioName());
|
||||
portfolio.setPortfolioType("History");
|
||||
portfolio.setCollectionId(collectionIdNew);
|
||||
portfolio.setAccountId(authPrincipalVo.getId());
|
||||
portfolio.setCreateDate(LocalDateTime.now());
|
||||
portfolio.setUpdateDate(LocalDateTime.now());
|
||||
portfolio.setStatus(1);
|
||||
portfolio.setOpenSource(1);
|
||||
portfolio.setIsDeleted(0);
|
||||
portfolio.setUserLikeGroupSourceId(portfolioDTO.getUserLikeGroupId());
|
||||
portfolio.setCanvasId(canvas.getId());
|
||||
portfolio.setPortfolioDes(portfolioDTO.getPortfolioDes());
|
||||
if (!CollectionUtils.isEmpty(portfolios)) {
|
||||
portfolioMapper.updateById(portfolio);
|
||||
} else {
|
||||
portfolioMapper.insert(portfolio);
|
||||
}
|
||||
resultPortfolioId = portfolio.getId();
|
||||
portfolioId = portfolio.getId();
|
||||
|
||||
List<UserLike> userLikeList = userLikeService.getUserLikeList(portfolioDTO.getUserLikeGroupId());
|
||||
for (UserLike userLike : userLikeList) {
|
||||
Long designOutfitIdOld = userLike.getDesignOutfitId();
|
||||
TDesignPythonOutfit designPythonOutfit = designPythonOutfitMapper.selectById(designOutfitIdOld);
|
||||
designPythonOutfit.setDesignId(-1L);
|
||||
designPythonOutfit.setDesignItemId(-1L);
|
||||
designPythonOutfit.setCollectionId(collectionIdNew);
|
||||
designPythonOutfit.setId(null);
|
||||
Long designItemIdOld = userLike.getDesignItemId();
|
||||
DesignItem designItemOld = designItemMapper.selectById(designItemIdOld);
|
||||
designItemOld.setId(null);
|
||||
designItemOld.setAccountId(-1L);
|
||||
designItemOld.setDesignId(-1L);
|
||||
designItemOld.setCollectionId(collectionIdNew);
|
||||
designItemMapper.insert(designItemOld);
|
||||
Long designItemIdNew = designItemOld.getId();
|
||||
UserLikeGroup userLikeGroup = userLikeService.getUserLikeGroupByProjectId(projectId);
|
||||
if (Objects.nonNull(userLikeGroup)) {
|
||||
UserLikeGroup userLikeGroupNew = CopyUtil.copyObject(userLikeGroup, UserLikeGroup.class);
|
||||
userLikeGroupNew.setId(null);
|
||||
userLikeGroupNew.setAccountId(-1L);
|
||||
userLikeGroupNew.setProjectId(projectIdCopy);
|
||||
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);
|
||||
|
||||
designPythonOutfit.setDesignItemId(designItemIdNew);
|
||||
designPythonOutfitMapper.insert(designPythonOutfit);
|
||||
Long designOutfitIdNew = designPythonOutfit.getId();
|
||||
userLike.setDesignOutfitId(designOutfitIdNew);
|
||||
QueryWrapper<TDesignPythonOutfitDetail> qw = new QueryWrapper<>();
|
||||
qw.lambda().eq(TDesignPythonOutfitDetail::getDesignPythonOutfitId, designOutfitIdOld);
|
||||
List<TDesignPythonOutfitDetail> tDesignPythonOutfitDetails = designPythonOutfitDetailMapper.selectList(qw);
|
||||
for (TDesignPythonOutfitDetail tDesignPythonOutfitDetail : tDesignPythonOutfitDetails) {
|
||||
tDesignPythonOutfitDetail.setId(null);
|
||||
tDesignPythonOutfitDetail.setDesignId(-1L);
|
||||
tDesignPythonOutfitDetail.setDesignPythonOutfitId(designOutfitIdNew);
|
||||
designPythonOutfitDetailMapper.insert(tDesignPythonOutfitDetail);
|
||||
collectionOld.setId(null);
|
||||
collectionMapper.insert(collectionOld);
|
||||
Long collectionIdNew = collectionOld.getId();
|
||||
|
||||
portfolio.setCollectionId(collectionIdNew);
|
||||
|
||||
for (CollectionElement element : collectionElementListOld) {
|
||||
element.setCollectionId(collectionIdNew);
|
||||
collectionElementMapper.updateById(element);
|
||||
TCollectionElementRelation collectionElementRelationNew = new TCollectionElementRelation();
|
||||
collectionElementRelationNew.setCollectionId(collectionIdNew);
|
||||
collectionElementRelationNew.setElementId(element.getId());
|
||||
collectionElementRelationNew.setCreateDate(new Date());
|
||||
collectionElementRelationMapper.insert(collectionElementRelationNew);
|
||||
}
|
||||
|
||||
userLike.setDesignItemId(designItemIdNew);
|
||||
userLike.setId(null);
|
||||
userLike.setDesignId(-1L);
|
||||
userLike.setUserLikeGroupId(userLikeGroupNew.getId());
|
||||
userLikeMapper.insert(userLike);
|
||||
QueryWrapper<DesignItemDetail> designItemDetailQueryWrapper = new QueryWrapper<>();
|
||||
designItemDetailQueryWrapper.lambda().eq(DesignItemDetail::getDesignItemId, designItemIdOld);
|
||||
List<DesignItemDetail> designItemDetailListOld = designItemDetailMapper.selectList(designItemDetailQueryWrapper);
|
||||
for (DesignItemDetail designItemDetailOld : designItemDetailListOld) {
|
||||
Long designItemDetailIdOld = designItemDetailOld.getId();
|
||||
designItemDetailOld.setId(null);
|
||||
designItemDetailOld.setAccountId(-1L);
|
||||
designItemDetailOld.setDesignId(-1L);
|
||||
designItemDetailOld.setDesignItemId(designItemIdNew);
|
||||
designItemDetailMapper.insert(designItemDetailOld);
|
||||
Long designItemDetailIdNew = designItemDetailOld.getId();
|
||||
QueryWrapper<DesignItemDetailPrint> designItemDetailPrintQueryWrapper = new QueryWrapper<>();
|
||||
designItemDetailPrintQueryWrapper.lambda().eq(DesignItemDetailPrint::getDesignItemDetailId, designItemDetailIdOld);
|
||||
List<DesignItemDetailPrint> designItemDetailPrints = designItemDetailPrintMapper.selectList(designItemDetailPrintQueryWrapper);
|
||||
for (DesignItemDetailPrint designItemDetailPrint : designItemDetailPrints) {
|
||||
designItemDetailPrint.setId(null);
|
||||
designItemDetailPrint.setDesignItemDetailId(designItemDetailIdNew);
|
||||
designItemDetailPrintMapper.insert(designItemDetailPrint);
|
||||
designOld.setCollectionId(collectionIdNew);
|
||||
designOld.setId(null);
|
||||
designMapper.insert(designOld);
|
||||
userLikeGroupNew.setCollectionId(collectionIdNew);
|
||||
userLikeGroupMapper.insert(userLikeGroupNew);
|
||||
List<UserLike> userLikeList = userLikeService.getUserLikeList(portfolioDTO.getUserLikeGroupId());
|
||||
for (UserLike userLike : userLikeList) {
|
||||
Long designOutfitIdOld = userLike.getDesignOutfitId();
|
||||
TDesignPythonOutfit designPythonOutfit = designPythonOutfitMapper.selectById(designOutfitIdOld);
|
||||
designPythonOutfit.setDesignId(-1L);
|
||||
designPythonOutfit.setDesignItemId(-1L);
|
||||
designPythonOutfit.setCollectionId(collectionIdNew);
|
||||
designPythonOutfit.setId(null);
|
||||
Long designItemIdOld = userLike.getDesignItemId();
|
||||
DesignItem designItemOld = designItemMapper.selectById(designItemIdOld);
|
||||
designItemOld.setId(null);
|
||||
designItemOld.setAccountId(-1L);
|
||||
designItemOld.setDesignId(-1L);
|
||||
designItemOld.setCollectionId(collectionIdNew);
|
||||
designItemMapper.insert(designItemOld);
|
||||
Long designItemIdNew = designItemOld.getId();
|
||||
|
||||
designPythonOutfit.setDesignItemId(designItemIdNew);
|
||||
designPythonOutfitMapper.insert(designPythonOutfit);
|
||||
Long designOutfitIdNew = designPythonOutfit.getId();
|
||||
userLike.setDesignOutfitId(designOutfitIdNew);
|
||||
QueryWrapper<TDesignPythonOutfitDetail> qw = new QueryWrapper<>();
|
||||
qw.lambda().eq(TDesignPythonOutfitDetail::getDesignPythonOutfitId, designOutfitIdOld);
|
||||
List<TDesignPythonOutfitDetail> tDesignPythonOutfitDetails = designPythonOutfitDetailMapper.selectList(qw);
|
||||
for (TDesignPythonOutfitDetail tDesignPythonOutfitDetail : tDesignPythonOutfitDetails) {
|
||||
tDesignPythonOutfitDetail.setId(null);
|
||||
tDesignPythonOutfitDetail.setDesignId(-1L);
|
||||
tDesignPythonOutfitDetail.setDesignPythonOutfitId(designOutfitIdNew);
|
||||
designPythonOutfitDetailMapper.insert(tDesignPythonOutfitDetail);
|
||||
}
|
||||
|
||||
userLike.setDesignItemId(designItemIdNew);
|
||||
userLike.setId(null);
|
||||
userLike.setDesignId(-1L);
|
||||
userLike.setUserLikeGroupId(userLikeGroupNew.getId());
|
||||
userLikeMapper.insert(userLike);
|
||||
QueryWrapper<DesignItemDetail> designItemDetailQueryWrapper = new QueryWrapper<>();
|
||||
designItemDetailQueryWrapper.lambda().eq(DesignItemDetail::getDesignItemId, designItemIdOld);
|
||||
List<DesignItemDetail> designItemDetailListOld = designItemDetailMapper.selectList(designItemDetailQueryWrapper);
|
||||
for (DesignItemDetail designItemDetailOld : designItemDetailListOld) {
|
||||
Long designItemDetailIdOld = designItemDetailOld.getId();
|
||||
designItemDetailOld.setId(null);
|
||||
designItemDetailOld.setAccountId(-1L);
|
||||
designItemDetailOld.setDesignId(-1L);
|
||||
designItemDetailOld.setDesignItemId(designItemIdNew);
|
||||
designItemDetailMapper.insert(designItemDetailOld);
|
||||
Long designItemDetailIdNew = designItemDetailOld.getId();
|
||||
QueryWrapper<DesignItemDetailPrint> designItemDetailPrintQueryWrapper = new QueryWrapper<>();
|
||||
designItemDetailPrintQueryWrapper.lambda().eq(DesignItemDetailPrint::getDesignItemDetailId, designItemDetailIdOld);
|
||||
List<DesignItemDetailPrint> designItemDetailPrints = designItemDetailPrintMapper.selectList(designItemDetailPrintQueryWrapper);
|
||||
for (DesignItemDetailPrint designItemDetailPrint : designItemDetailPrints) {
|
||||
designItemDetailPrint.setId(null);
|
||||
designItemDetailPrint.setDesignItemDetailId(designItemDetailIdNew);
|
||||
designItemDetailPrintMapper.insert(designItemDetailPrint);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
QueryWrapper<Portfolio> portfolioQueryWrapper = new QueryWrapper<>();
|
||||
portfolioQueryWrapper.lambda().eq(Portfolio::getUserLikeGroupSourceId, portfolioDTO.getUserLikeGroupId());
|
||||
List<Portfolio> portfolios = portfolioMapper.selectList(portfolioQueryWrapper);
|
||||
Portfolio portfolio = new Portfolio();
|
||||
if (!CollectionUtils.isEmpty(portfolios)) {
|
||||
portfolio = portfolios.get(0);
|
||||
}
|
||||
UserLikeGroup userLikeGroup = userLikeGroupMapper.selectById(portfolioDTO.getUserLikeGroupId());
|
||||
if (userLikeGroup.getOriginal() == 0) {
|
||||
portfolio.setOriginal(0);
|
||||
portfolio.setOriginalAccountId(userLikeGroup.getOriginalAccountId());
|
||||
portfolio.setOriginalPortfolioId(userLikeGroup.getOriginalPortfolioId());
|
||||
} else {
|
||||
portfolio.setOriginal(1);
|
||||
// portfolio.setOriginalAccountId(authPrincipalVo.getId());
|
||||
}
|
||||
portfolio.setPortfolioName(portfolioDTO.getPortfolioName());
|
||||
|
||||
portfolio.setPortfolioType("Canvas");
|
||||
portfolio.setAccountId(authPrincipalVo.getId());
|
||||
portfolio.setCreateDate(LocalDateTime.now());
|
||||
portfolio.setUpdateDate(LocalDateTime.now());
|
||||
portfolio.setStatus(1);
|
||||
portfolio.setIsDeleted(0);
|
||||
|
||||
portfolio.setOpenSource(0);
|
||||
portfolio.setUserLikeGroupSourceId(portfolioDTO.getUserLikeGroupId());
|
||||
portfolio.setCanvasId(canvas.getId());
|
||||
portfolio.setPortfolioDes(portfolioDTO.getPortfolioDes());
|
||||
if (!CollectionUtils.isEmpty(portfolios)) {
|
||||
portfolioMapper.updateById(portfolio);
|
||||
} else {
|
||||
portfolioMapper.insert(portfolio);
|
||||
}
|
||||
resultPortfolioId = portfolio.getId();
|
||||
portfolioId = portfolio.getId();
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(portfolioList)) {
|
||||
portfolioMapper.updateById(portfolio);
|
||||
} else {
|
||||
portfolioMapper.insert(portfolio);
|
||||
}
|
||||
resultPortfolioId = portfolio.getId();
|
||||
portfolioId = portfolio.getId();
|
||||
// id不为空 表示更新发布;为空,表示新发布
|
||||
if (!Objects.isNull(portfolioDTO.getId())){
|
||||
portfolioId = portfolioDTO.getId();
|
||||
@@ -655,6 +635,9 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
||||
public ProjectChooseVO choose(PortfolioDTO portfolioDTO) {
|
||||
AuthPrincipalVo authPrincipalVo = UserContext.getUserHolder();
|
||||
Portfolio portfolio = portfolioMapper.selectById(portfolioDTO.getId());
|
||||
|
||||
Long projectId = portfolio.getProjectId();
|
||||
|
||||
QueryWrapper<UserLikeGroup> userLikeGroupQueryWrapper = new QueryWrapper<>();
|
||||
userLikeGroupQueryWrapper.lambda().eq(UserLikeGroup::getCollectionId, portfolio.getCollectionId());
|
||||
UserLikeGroup userLikeGroup = userLikeGroupMapper.selectOne(userLikeGroupQueryWrapper);
|
||||
|
||||
@@ -274,7 +274,20 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
||||
}
|
||||
}
|
||||
|
||||
return new ProjectChooseVO(projectDTO.getId(), name, workspaceVO, process, collectionId);
|
||||
Integer beenPublished = 0;
|
||||
QueryWrapper<Portfolio> qw = new QueryWrapper<>();
|
||||
qw.lambda().eq(Portfolio::getProjectId, projectDTO.getId());
|
||||
List<Portfolio> portfolios = portfolioMapper.selectList(qw);
|
||||
// Portfolio portfolio = new Portfolio();
|
||||
PortfolioDTO portfolioDTO = new PortfolioDTO();
|
||||
if (CollectionUtil.isNotEmpty(portfolios)) {
|
||||
// portfolio = portfolios.get(0);
|
||||
portfolioDTO = CopyUtil.copyObject(portfolios.get(0), PortfolioDTO.class);
|
||||
beenPublished = 1;
|
||||
portfolioDTO.setTagsDTO(tagsMapper.getTagByPortfolioId(portfolioDTO.getId()));
|
||||
}
|
||||
|
||||
return new ProjectChooseVO(projectDTO.getId(), name, workspaceVO, process, collectionId, beenPublished, portfolioDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -701,8 +714,6 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
||||
}
|
||||
jsonObject.put("objects", objectJSONArrayLevel1);
|
||||
}
|
||||
|
||||
System.out.println(jsonObject);
|
||||
return jsonObject;
|
||||
}catch (Exception e){
|
||||
return null;
|
||||
@@ -1894,10 +1905,23 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
||||
}
|
||||
}
|
||||
if (moduleSaveDTO.getPatternMaking3D() != null) {
|
||||
ThreeDModule threeDModule = new ThreeDModule();
|
||||
threeDModule.setProjectId(projectId);
|
||||
threeDModule.setThreeDSimpleId(moduleSaveDTO.getPatternMaking3D());
|
||||
threeDModuleMapper.insert(threeDModule);
|
||||
|
||||
QueryWrapper<ThreeDModule> threeDModuleQueryWrapper = new QueryWrapper<>();
|
||||
threeDModuleQueryWrapper.lambda().eq(ThreeDModule::getProjectId, projectId);
|
||||
List<ThreeDModule> threeDModuleList = threeDModuleMapper.selectList(threeDModuleQueryWrapper);
|
||||
|
||||
if (CollectionUtils.isEmpty(threeDModuleList)) {
|
||||
ThreeDModule threeDModule = new ThreeDModule();
|
||||
threeDModule.setProjectId(projectId);
|
||||
threeDModule.setThreeDSimpleId(moduleSaveDTO.getPatternMaking3D());
|
||||
threeDModuleMapper.insert(threeDModule);
|
||||
}else {
|
||||
ThreeDModule threeDModule = threeDModuleList.get(0);
|
||||
if (!Objects.equals(moduleSaveDTO.getPatternMaking3D(), threeDModule.getThreeDSimpleId())) {
|
||||
threeDModule.setThreeDSimpleId(moduleSaveDTO.getPatternMaking3D());
|
||||
threeDModuleMapper.updateById(threeDModule);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (boundingBox) {
|
||||
QueryWrapper<CollectionElement> qw = new QueryWrapper<>();
|
||||
@@ -1994,7 +2018,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
||||
}
|
||||
|
||||
@Override
|
||||
public Library brandDNAUpload(MultipartFile file, Long brandId) throws IOException {
|
||||
public LibraryUpdateVo brandDNAUpload(MultipartFile file, Long brandId) throws IOException {
|
||||
AuthPrincipalVo userHolder = UserContext.getUserHolder();
|
||||
String path = userHolder.getId().toString() + "/brandLogo";
|
||||
String upload = minioUtil.upload("aida-users", path, file);
|
||||
@@ -2012,7 +2036,10 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
||||
brandRelLibrary.setBrandId(brandId);
|
||||
brandRelLibraryMapper.insert(brandRelLibrary);
|
||||
|
||||
return library;
|
||||
LibraryUpdateVo vo = CopyUtil.copyObject(library, LibraryUpdateVo.class);
|
||||
vo.setMinIOPath(minioUtil.getPreSignedUrl(vo.getUrl(), 24 * 60));
|
||||
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2047,10 +2074,12 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
||||
@Override
|
||||
public IPage<ThreeDLayoutVO> getThreeDLayoutPage(ThreeDLayoutQueryDTO query) {
|
||||
// AuthPrincipalVo authPrincipalVo = UserContext.getUserHolder();
|
||||
// Long workspaceServiceByProjectId = workspaceService.getByProjectId(query.getProjectId());
|
||||
// Workspace byId = workspaceService.getById(workspaceServiceByProjectId);
|
||||
// 分页数据
|
||||
QueryWrapper<ThreeDLayout> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(ThreeDLayout::getType, "front");
|
||||
queryWrapper.lambda().eq(ThreeDLayout::getGender, "female");
|
||||
queryWrapper.lambda().eq(ThreeDLayout::getGender, query.getSex().toLowerCase());
|
||||
IPage<ThreeDLayout> page = threeDLayoutMapper.selectPage(
|
||||
new Page<>(query.getPage(), query.getSize()), queryWrapper);
|
||||
if (CollectionUtils.isEmpty(page.getRecords())) {
|
||||
|
||||
Reference in New Issue
Block a user