1、局部design 未保存前,不覆盖原图
2、打开前后片编辑
This commit is contained in:
@@ -83,5 +83,7 @@ public class CommonConstant {
|
|||||||
|
|
||||||
public static final String PARTIAL_DESIGN_FILENAME = "PartialDesign";
|
public static final String PARTIAL_DESIGN_FILENAME = "PartialDesign";
|
||||||
|
|
||||||
|
public static final String PARTIAL_DESIGN_PREVIEW_FILENAME = "Preview";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -509,15 +509,15 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
|||||||
// 将标注后的mask上传到minio,并将minio地址传给python端
|
// 将标注后的mask上传到minio,并将minio地址传给python端
|
||||||
// todo 如果当前design使用的仍是旧的mask 则置maskUrl为null
|
// todo 如果当前design使用的仍是旧的mask 则置maskUrl为null
|
||||||
// 1、查询当前design item在不在history中
|
// 1、查询当前design item在不在history中
|
||||||
/* UserLike userLikeDesign = userLikeService.getByDesignItemId(designItem.getId());
|
UserLike userLikeDesign = userLikeService.getByDesignItemId(designItem.getId());
|
||||||
Boolean setNull = Boolean.FALSE;
|
Boolean setNull = Boolean.FALSE;
|
||||||
if (!Objects.isNull(userLikeDesign) && userLikeDesign.getConverted() == 0){
|
if (!Objects.isNull(userLikeDesign) && userLikeDesign.getConverted() == 0){
|
||||||
setNull = Boolean.TRUE;
|
setNull = Boolean.TRUE;
|
||||||
}*/
|
}
|
||||||
// maskBase64ToPath(designSingleIncludeLayersDTO, setNull);
|
maskBase64ToPath(designSingleIncludeLayersDTO, setNull);
|
||||||
maskBase64ToPath(designSingleIncludeLayersDTO, Boolean.TRUE);
|
// maskBase64ToPath(designSingleIncludeLayersDTO, Boolean.TRUE);
|
||||||
|
|
||||||
partialDesignBase64ToImage(designSingleIncludeLayersDTO, userId);
|
partialDesignBase64ToImage(designSingleIncludeLayersDTO, userId, designSingleIncludeLayersDTO.getIsPreview());
|
||||||
|
|
||||||
// 组装入参
|
// 组装入参
|
||||||
DesignPythonObjects objects = pythonService.covertDesignSingleParam(
|
DesignPythonObjects objects = pythonService.covertDesignSingleParam(
|
||||||
@@ -626,19 +626,20 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void partialDesignBase64ToImage(DesignSingleIncludeLayersDTO designSingleIncludeLayersDTO, Long accountId){
|
private void partialDesignBase64ToImage(DesignSingleIncludeLayersDTO designSingleIncludeLayersDTO, Long accountId, boolean preview){
|
||||||
designSingleIncludeLayersDTO.getDesignSingleItemDTOList().forEach(item -> {
|
designSingleIncludeLayersDTO.getDesignSingleItemDTOList().forEach(item -> {
|
||||||
PartialDesignDTO partialDesignDTO = item.getPartialDesign();
|
PartialDesignDTO partialDesignDTO = item.getPartialDesign();
|
||||||
if (!Objects.isNull(item.getPartialDesign())
|
if (!Objects.isNull(item.getPartialDesign())
|
||||||
&& !StringUtil.isNullOrEmpty(item.getPartialDesign().getPartialDesignBase64())){
|
&& !StringUtil.isNullOrEmpty(item.getPartialDesign().getPartialDesignBase64())){
|
||||||
String path ;
|
String path ;
|
||||||
if (!StringUtil.isNullOrEmpty(partialDesignDTO.getPartialDesignMinioPath())){
|
if (!StringUtil.isNullOrEmpty(partialDesignDTO.getPartialDesignMinioPath()) && !preview){
|
||||||
String sourcePath = partialDesignDTO.getPartialDesignMinioPath();
|
String sourcePath = partialDesignDTO.getPartialDesignMinioPath();
|
||||||
path = sourcePath.substring(sourcePath.indexOf("/") + 1, sourcePath.lastIndexOf("."));
|
path = sourcePath.substring(sourcePath.indexOf("/") + 1, sourcePath.lastIndexOf("."));
|
||||||
|
}else if (preview){
|
||||||
|
path = accountId + "/" + CommonConstant.PARTIAL_DESIGN_PREVIEW_FILENAME + "/" + UUID.randomUUID();
|
||||||
}else {
|
}else {
|
||||||
path = accountId + "/" + CommonConstant.PARTIAL_DESIGN_FILENAME + "/" + UUID.randomUUID();
|
path = accountId + "/" + CommonConstant.PARTIAL_DESIGN_FILENAME + "/" + UUID.randomUUID();
|
||||||
}
|
}
|
||||||
// todo 将原图地址作为修改后的图片地址,放在不同的桶
|
|
||||||
String newPath = minioUtil.base64UploadToPath(partialDesignDTO.getPartialDesignBase64(), partialDesignBucket, path);
|
String newPath = minioUtil.base64UploadToPath(partialDesignDTO.getPartialDesignBase64(), partialDesignBucket, path);
|
||||||
if (StringUtil.isNullOrEmpty(newPath)){
|
if (StringUtil.isNullOrEmpty(newPath)){
|
||||||
log.error("局部design图片上传失败");
|
log.error("局部design图片上传失败");
|
||||||
|
|||||||
Reference in New Issue
Block a user