TASK:design 渐变色;

This commit is contained in:
shahaibo
2024-05-10 17:17:28 +08:00
parent e2697aa407
commit b86f168fe8
17 changed files with 210 additions and 83 deletions

View File

@@ -1548,7 +1548,9 @@ public class PythonService {
pythonItem.setPath(sysFileVO.getUrl());
pythonItem.setBusinessId(sysFileVO.getId());
if (SysFileLevel2TypeEnum.SHOES.getRealName().equals(type)) {
pythonItem.setColor(getRandomColor(elementVO.getColorBoards()));
CollectionColorDTO randomColor = getRandomColor(elementVO.getColorBoards());
pythonItem.setColor(randomColor.getRgbValue());
pythonItem.setGradient(randomColor.getGradientMinioUrl());
}
}
}
@@ -1911,7 +1913,9 @@ public class PythonService {
designPythonItemBlouse.setPath(path);
//所有的icon都是none
designPythonItemBlouse.setIcon("none");
designPythonItemBlouse.setColor(getRandomColor(elementVO.getColorBoards()));
CollectionColorDTO randomColor = getRandomColor(elementVO.getColorBoards());
designPythonItemBlouse.setColor(randomColor.getRgbValue());
designPythonItemBlouse.setGradient(randomColor.getGradientMinioUrl());
if (!elementVO.getDesignPythonItemPrint().getPath().equals("none")
&& elementVO.getDesignPrintPictureTypeLayoutList().contains(type)) {
DesignPythonItemPrint designPythonItemPrint = CopyUtil.copyObject(elementVO.getDesignPythonItemPrint(), DesignPythonItemPrint.class);
@@ -1937,7 +1941,9 @@ public class PythonService {
designPythonItemBlouse.setPath(collectionElement.getUrl());
//所有的icon都是none
designPythonItemBlouse.setIcon("none");
designPythonItemBlouse.setColor(getRandomColor(elementVO.getColorBoards()));
CollectionColorDTO randomColor = getRandomColor(elementVO.getColorBoards());
designPythonItemBlouse.setColor(randomColor.getRgbValue());
designPythonItemBlouse.setGradient(randomColor.getGradientMinioUrl());
if (!elementVO.getDesignPythonItemPrint().getPath().equals("none")
&& elementVO.getDesignPrintPictureTypeLayoutList().contains(collectionElement.getLevel2Type())) {
DesignPythonItemPrint designPythonItemPrint = CopyUtil.copyObject(elementVO.getDesignPythonItemPrint(), DesignPythonItemPrint.class);
@@ -2216,14 +2222,14 @@ public class PythonService {
return sysFileVo.get(key.intValue());
}
private String getRandomColor(List<CollectionColorDTO> colorBoards) {
private CollectionColorDTO getRandomColor(List<CollectionColorDTO> colorBoards) {
if (colorBoards.size() == 1) {
return colorBoards.get(0).getRgbValue();
return colorBoards.get(0);
}
long maxColor = colorBoards.size();
long minColor = 0;
Long randomIndex = RandomsUtil.randomSysFile(minColor, maxColor);
return colorBoards.get(randomIndex.intValue()).getRgbValue();
return colorBoards.get(randomIndex.intValue());
}
private CollectionElement getRandomSketchLibrary(List<CollectionElement> sketchBoardElementOlds, List<String> hasUseMd5List) {

View File

@@ -28,6 +28,8 @@ public class DesignPythonItem {
*/
private String color;
private String gradient;
/**
* 对应的print图片的绝对路径
*/
@@ -74,7 +76,7 @@ public class DesignPythonItem {
*/
private Integer priority;
private List<List<Integer>> gradient;
// private List<List<Integer>> gradient;
private Float gradient_angle;
@@ -126,7 +128,7 @@ public class DesignPythonItem {
this.priority = priority;
}
public DesignPythonItem(String type, String path, String color, DesignPythonItemPrint print, Long businessId, Long image_id, List<Long> offset, Float resize_scale,Integer priority, List<List<Integer>> gradient, Float gradient_angle) {
public DesignPythonItem(String type, String path, String color, DesignPythonItemPrint print, Long businessId, Long image_id, List<Long> offset, Float resize_scale,Integer priority, String gradient, Float gradient_angle) {
this.type = type;
this.path = path;
this.color = color;