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