BUGFIX:渐变色回退;

This commit is contained in:
shahaibo
2024-05-28 11:32:49 +08:00
parent 709393a9a6
commit 40aad9d1a3
4 changed files with 28 additions and 28 deletions

View File

@@ -75,7 +75,7 @@ public class CollectionElement implements Serializable {
*/ */
private String md5; private String md5;
private String gradientString; // private String gradientString;
/** /**
* 创建时间 * 创建时间

View File

@@ -26,9 +26,9 @@ public class CollectionColorDTO {
@ApiModelProperty("潘通RGB值") @ApiModelProperty("潘通RGB值")
private String rgbValue; private String rgbValue;
private Gradient gradient; // private Gradient gradient;
//
private String gradientString; // private String gradientString;
private String gradientMinioUrl; private String gradientMinioUrl;

View File

@@ -1556,8 +1556,8 @@ public class PythonService {
if (SysFileLevel2TypeEnum.SHOES.getRealName().equals(type)) { if (SysFileLevel2TypeEnum.SHOES.getRealName().equals(type)) {
CollectionColorDTO randomColor = getRandomColor(elementVO.getColorBoards()); CollectionColorDTO randomColor = getRandomColor(elementVO.getColorBoards());
pythonItem.setColor(randomColor.getRgbValue()); pythonItem.setColor(randomColor.getRgbValue());
pythonItem.setGradient(randomColor.getGradientMinioUrl()); // pythonItem.setGradient(randomColor.getGradientMinioUrl());
pythonItem.setGradientString(randomColor.getGradientString()); // pythonItem.setGradientString(randomColor.getGradientString());
} }
} }
} }
@@ -1922,8 +1922,8 @@ public class PythonService {
designPythonItemBlouse.setIcon("none"); designPythonItemBlouse.setIcon("none");
CollectionColorDTO randomColor = getRandomColor(elementVO.getColorBoards()); CollectionColorDTO randomColor = getRandomColor(elementVO.getColorBoards());
designPythonItemBlouse.setColor(randomColor.getRgbValue()); designPythonItemBlouse.setColor(randomColor.getRgbValue());
designPythonItemBlouse.setGradient(randomColor.getGradientMinioUrl()); // designPythonItemBlouse.setGradient(randomColor.getGradientMinioUrl());
designPythonItemBlouse.setGradientString(randomColor.getGradientString()); // designPythonItemBlouse.setGradientString(randomColor.getGradientString());
if (!elementVO.getDesignPythonItemPrint().getPath().equals("none") if (!elementVO.getDesignPythonItemPrint().getPath().equals("none")
&& elementVO.getDesignPrintPictureTypeLayoutList().contains(type)) { && elementVO.getDesignPrintPictureTypeLayoutList().contains(type)) {
DesignPythonItemPrint designPythonItemPrint = CopyUtil.copyObject(elementVO.getDesignPythonItemPrint(), DesignPythonItemPrint.class); DesignPythonItemPrint designPythonItemPrint = CopyUtil.copyObject(elementVO.getDesignPythonItemPrint(), DesignPythonItemPrint.class);
@@ -1951,8 +1951,8 @@ public class PythonService {
designPythonItemBlouse.setIcon("none"); designPythonItemBlouse.setIcon("none");
CollectionColorDTO randomColor = getRandomColor(elementVO.getColorBoards()); CollectionColorDTO randomColor = getRandomColor(elementVO.getColorBoards());
designPythonItemBlouse.setColor(randomColor.getRgbValue()); designPythonItemBlouse.setColor(randomColor.getRgbValue());
designPythonItemBlouse.setGradient(randomColor.getGradientMinioUrl()); // designPythonItemBlouse.setGradient(randomColor.getGradientMinioUrl());
designPythonItemBlouse.setGradientString(randomColor.getGradientString()); // designPythonItemBlouse.setGradientString(randomColor.getGradientString());
if (!elementVO.getDesignPythonItemPrint().getPath().equals("none") if (!elementVO.getDesignPythonItemPrint().getPath().equals("none")
&& elementVO.getDesignPrintPictureTypeLayoutList().contains(collectionElement.getLevel2Type())) { && elementVO.getDesignPrintPictureTypeLayoutList().contains(collectionElement.getLevel2Type())) {
DesignPythonItemPrint designPythonItemPrint = CopyUtil.copyObject(elementVO.getDesignPythonItemPrint(), DesignPythonItemPrint.class); DesignPythonItemPrint designPythonItemPrint = CopyUtil.copyObject(elementVO.getDesignPythonItemPrint(), DesignPythonItemPrint.class);

View File

@@ -351,20 +351,20 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
@Override @Override
public ValidateElementVO validateElement(DesignCollectionDTO designDTO) { public ValidateElementVO validateElement(DesignCollectionDTO designDTO) {
ValidateElementVO elementVO = CopyUtil.copyObject(designDTO, ValidateElementVO.class); ValidateElementVO elementVO = CopyUtil.copyObject(designDTO, ValidateElementVO.class);
List<CollectionColorDTO> colorBoards = elementVO.getColorBoards(); // List<CollectionColorDTO> colorBoards = elementVO.getColorBoards();
for (CollectionColorDTO colorBoard : colorBoards) { // for (CollectionColorDTO colorBoard : colorBoards) {
if (Objects.nonNull(colorBoard.getGradient())) { // if (Objects.nonNull(colorBoard.getGradient())) {
String colorImg = colorBoard.getGradient().getColorImg(); // String colorImg = colorBoard.getGradient().getColorImg();
String[] parts = colorImg.split(","); // String[] parts = colorImg.split(",");
String imageType = parts[0].split("/")[1].split(";")[0]; // String imageType = parts[0].split("/")[1].split(";")[0];
String base64Data = parts[1]; // String base64Data = parts[1];
String gradientMinioUrl = minioUtil.uploadImageFromBase64(gradientBucketName, base64Data, imageType); // String gradientMinioUrl = minioUtil.uploadImageFromBase64(gradientBucketName, base64Data, imageType);
colorBoard.setGradientMinioUrl(gradientMinioUrl); // colorBoard.setGradientMinioUrl(gradientMinioUrl);
colorBoard.getGradient().setColorImg(null); // colorBoard.getGradient().setColorImg(null);
colorBoard.setGradientString(JSON.toJSONString(colorBoard.getGradient())); // colorBoard.setGradientString(JSON.toJSONString(colorBoard.getGradient()));
} // }
} // }
elementVO.setColorBoards(colorBoards); // elementVO.setColorBoards(colorBoards);
List<Long> usedElementIds = elementVO.getUsedElementIds(); List<Long> usedElementIds = elementVO.getUsedElementIds();
List<CollectionElement> libraryCollectionElements = elementVO.getLibraryCollectionElements(); List<CollectionElement> libraryCollectionElements = elementVO.getLibraryCollectionElements();
List<CollectionElement> generateCollectionElements = elementVO.getGenerateCollectionElements(); List<CollectionElement> generateCollectionElements = elementVO.getGenerateCollectionElements();
@@ -783,10 +783,10 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
element.setColorRgb(color.getRgbValue()); element.setColorRgb(color.getRgbValue());
//按时区计算 //按时区计算
element.setCreateDate(DateUtil.getByTimeZone(timeZone)); element.setCreateDate(DateUtil.getByTimeZone(timeZone));
if (Objects.nonNull(color.getGradient())) { // if (Objects.nonNull(color.getGradient())) {
color.getGradient().setColorImg(null); // color.getGradient().setColorImg(null);
} // }
element.setGradientString(JSON.toJSONString(color.getGradient())); // element.setGradientString(JSON.toJSONString(color.getGradient()));
elements.add(element); elements.add(element);
}); });
return elements; return elements;