TASK:design 渐变色;
This commit is contained in:
@@ -154,63 +154,63 @@ public class GenerateConsumer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@RabbitListener(queues = MQConfig.GENERATE_QUEUE)
|
// @RabbitListener(queues = MQConfig.GENERATE_QUEUE)
|
||||||
@RabbitHandler
|
// @RabbitHandler
|
||||||
public void generateConsumer1(Message msg, Channel channel) {
|
// public void generateConsumer1(Message msg, Channel channel) {
|
||||||
generate(msg, channel, "consumer 1");
|
// generate(msg, channel, "consumer 1");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@RabbitListener(queues = MQConfig.GENERATE_QUEUE)
|
// @RabbitListener(queues = MQConfig.GENERATE_QUEUE)
|
||||||
@RabbitHandler
|
// @RabbitHandler
|
||||||
public void generateConsumer2(Message msg, Channel channel) {
|
// public void generateConsumer2(Message msg, Channel channel) {
|
||||||
generate(msg, channel, "consumer 2");
|
// generate(msg, channel, "consumer 2");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@RabbitListener(queues = MQConfig.GENERATE_QUEUE)
|
// @RabbitListener(queues = MQConfig.GENERATE_QUEUE)
|
||||||
@RabbitHandler
|
// @RabbitHandler
|
||||||
public void generateConsumer3(Message msg, Channel channel) {
|
// public void generateConsumer3(Message msg, Channel channel) {
|
||||||
generate(msg, channel, "consumer 3");
|
// generate(msg, channel, "consumer 3");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@RabbitListener(queues = MQConfig.GENERATE_QUEUE)
|
// @RabbitListener(queues = MQConfig.GENERATE_QUEUE)
|
||||||
@RabbitHandler
|
// @RabbitHandler
|
||||||
public void generateConsumer4(Message msg, Channel channel) {
|
// public void generateConsumer4(Message msg, Channel channel) {
|
||||||
generate(msg, channel, "consumer 4");
|
// generate(msg, channel, "consumer 4");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@RabbitListener(queues = MQConfig.GENERATE_QUEUE)
|
// @RabbitListener(queues = MQConfig.GENERATE_QUEUE)
|
||||||
@RabbitHandler
|
// @RabbitHandler
|
||||||
public void generateConsumer5(Message msg, Channel channel) {
|
// public void generateConsumer5(Message msg, Channel channel) {
|
||||||
generate(msg, channel, "consumer 5");
|
// generate(msg, channel, "consumer 5");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@RabbitListener(queues = MQConfig.GENERATE_QUEUE)
|
// @RabbitListener(queues = MQConfig.GENERATE_QUEUE)
|
||||||
@RabbitHandler
|
// @RabbitHandler
|
||||||
public void generateConsumer6(Message msg, Channel channel) {
|
// public void generateConsumer6(Message msg, Channel channel) {
|
||||||
generate(msg, channel, "consumer 6");
|
// generate(msg, channel, "consumer 6");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@RabbitListener(queues = MQConfig.GENERATE_QUEUE)
|
// @RabbitListener(queues = MQConfig.GENERATE_QUEUE)
|
||||||
@RabbitHandler
|
// @RabbitHandler
|
||||||
public void generateConsumer7(Message msg, Channel channel) {
|
// public void generateConsumer7(Message msg, Channel channel) {
|
||||||
generate(msg, channel, "consumer 7");
|
// generate(msg, channel, "consumer 7");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@RabbitListener(queues = MQConfig.GENERATE_QUEUE)
|
// @RabbitListener(queues = MQConfig.GENERATE_QUEUE)
|
||||||
@RabbitHandler
|
// @RabbitHandler
|
||||||
public void generateConsumer8(Message msg, Channel channel) {
|
// public void generateConsumer8(Message msg, Channel channel) {
|
||||||
generate(msg, channel, "consumer 8");
|
// generate(msg, channel, "consumer 8");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@RabbitListener(queues = MQConfig.GENERATE_QUEUE)
|
// @RabbitListener(queues = MQConfig.GENERATE_QUEUE)
|
||||||
@RabbitHandler
|
// @RabbitHandler
|
||||||
public void generateConsumer9(Message msg, Channel channel) {
|
// public void generateConsumer9(Message msg, Channel channel) {
|
||||||
generate(msg, channel, "consumer 9");
|
// generate(msg, channel, "consumer 9");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@RabbitListener(queues = MQConfig.GENERATE_RESULT_QUEUE)
|
// @RabbitListener(queues = MQConfig.GENERATE_RESULT_QUEUE)
|
||||||
@RabbitHandler
|
// @RabbitHandler
|
||||||
public void getGenerateResult(Message msg, Channel channel) {
|
// public void getGenerateResult(Message msg, Channel channel) {
|
||||||
processGenerateResult(msg, channel);
|
// processGenerateResult(msg, channel);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -218,17 +218,17 @@ public class SRConsumer {
|
|||||||
taskListService.updateTaskStatusOrOutputRedis(uniqueId, "fail", null);
|
taskListService.updateTaskStatusOrOutputRedis(uniqueId, "fail", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RabbitListener(queues = MQConfig.SR_QUEUE)
|
// @RabbitListener(queues = MQConfig.SR_QUEUE)
|
||||||
@RabbitHandler
|
// @RabbitHandler
|
||||||
public void SRConsumer1(Message msg, Channel channel) {
|
// public void SRConsumer1(Message msg, Channel channel) {
|
||||||
superResolution(msg, channel, "consumer 1");
|
// superResolution(msg, channel, "consumer 1");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
@RabbitListener(queues = MQConfig.SR_RESULT_QUEUE)
|
// @RabbitListener(queues = MQConfig.SR_RESULT_QUEUE)
|
||||||
@RabbitHandler
|
// @RabbitHandler
|
||||||
public void SRResultConsumer1(Message msg, Channel channel) {
|
// public void SRResultConsumer1(Message msg, Channel channel) {
|
||||||
getSRResult(msg, channel, "consumer 1");
|
// getSRResult(msg, channel, "consumer 1");
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,6 +127,11 @@ public class MyTaskScheduler {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
SendEmailUtil.sendNoExcelEmail("1023316923@qq.com", null);
|
||||||
|
SendEmailUtil.sendNoExcelEmail("calvinwong@aidlab.hk", null);
|
||||||
|
SendEmailUtil.sendNoExcelEmail("kaicpang.pang@connect.polyu.hk", null);
|
||||||
|
SendEmailUtil.sendNoExcelEmail("kimwong@code-create.com.hk", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class PaypalTask {
|
|||||||
@Resource
|
@Resource
|
||||||
private PayPalCheckoutService payPalCheckoutService;
|
private PayPalCheckoutService payPalCheckoutService;
|
||||||
|
|
||||||
@Scheduled(cron = "0/30 * * * * ?")
|
// @Scheduled(cron = "0/30 * * * * ?")
|
||||||
public void orderConfirm() throws SerializeException {
|
public void orderConfirm() throws SerializeException {
|
||||||
|
|
||||||
log.info("PayPal orderConfirm 被执行......");
|
log.info("PayPal orderConfirm 被执行......");
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import java.io.*;
|
|||||||
import java.security.InvalidKeyException;
|
import java.security.InvalidKeyException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Base64;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
@@ -126,6 +127,26 @@ public class MinioUtil {
|
|||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String uploadImageFromBase64(String bucketName, String base64Image, String imageType) {
|
||||||
|
byte[] imageBytes = Base64.getDecoder().decode(base64Image);
|
||||||
|
String fileName = UUID.randomUUID().toString() + "." + imageType; // or any other image format
|
||||||
|
|
||||||
|
try (InputStream in = new ByteArrayInputStream(imageBytes)) {
|
||||||
|
minioClient.putObject(PutObjectArgs.builder()
|
||||||
|
.bucket(bucketName)
|
||||||
|
.object(fileName)
|
||||||
|
.stream(in, in.available(), -1)
|
||||||
|
.contentType("image/png") // Set the content type according to your image format
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
return bucketName + "/" + fileName;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null; // or throw an exception
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* description: 上传文件
|
* description: 上传文件
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ public class SendEmailUtil {
|
|||||||
private final static Long NOTIFICATION_TEMPLATE_ID = 117216L;
|
private final static Long NOTIFICATION_TEMPLATE_ID = 117216L;
|
||||||
private final static Long NOTIFICATION_CHINESE_TEMPLATE_ID = 122229L;
|
private final static Long NOTIFICATION_CHINESE_TEMPLATE_ID = 122229L;
|
||||||
private final static Long TRIAL_ORDER_LIST_ID = 122273L;
|
private final static Long TRIAL_ORDER_LIST_ID = 122273L;
|
||||||
|
private final static Long NO_TRIAL_ORDER_LIST_ID = 122591L;
|
||||||
public static void sendCustomEmail(String receiverAddress, String senderAddress, TrialOrder trialOrder, int emailType, String country) {
|
public static void sendCustomEmail(String receiverAddress, String senderAddress, TrialOrder trialOrder, int emailType, String country) {
|
||||||
try {
|
try {
|
||||||
// 实例化一个认证对象
|
// 实例化一个认证对象
|
||||||
@@ -227,6 +228,39 @@ public class SendEmailUtil {
|
|||||||
throw new BusinessException("failed.to.send.mail");
|
throw new BusinessException("failed.to.send.mail");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void sendNoExcelEmail(String receiverAddress, String senderAddress) {
|
||||||
|
try {
|
||||||
|
// 实例化一个认证对象
|
||||||
|
Credential cred = new Credential(SECRET_ID, SECRET_KEy);
|
||||||
|
HttpProfile httpProfile = new HttpProfile();
|
||||||
|
httpProfile.setEndpoint("ses.tencentcloudapi.com");
|
||||||
|
ClientProfile clientProfile = new ClientProfile();
|
||||||
|
clientProfile.setHttpProfile(httpProfile);
|
||||||
|
SesClient client = new SesClient(cred, "ap-hongkong", clientProfile);
|
||||||
|
SendEmailRequest req = new SendEmailRequest();
|
||||||
|
if (StringUtils.isEmpty(senderAddress)) {
|
||||||
|
senderAddress = SEND_ADDRESS;
|
||||||
|
}
|
||||||
|
req.setFromEmailAddress(senderAddress);
|
||||||
|
req.setDestination(new String[]{receiverAddress});
|
||||||
|
|
||||||
|
// 根据邮件类型设置不同的主题和模板
|
||||||
|
String subject = "";
|
||||||
|
Template template = new Template();
|
||||||
|
subject = "昨日试用订单数据";
|
||||||
|
template.setTemplateID(NO_TRIAL_ORDER_LIST_ID);
|
||||||
|
|
||||||
|
req.setSubject(subject);
|
||||||
|
req.setTemplate(template);
|
||||||
|
// 发送邮件
|
||||||
|
SendEmailResponse resp = client.SendEmail(req);
|
||||||
|
log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp));
|
||||||
|
} catch (TencentCloudSDKException e) {
|
||||||
|
log.info("邮件发送失败###{}", e.toString());
|
||||||
|
throw new BusinessException("failed.to.send.mail");
|
||||||
|
}
|
||||||
|
}
|
||||||
private final static Long WILLBEEXPIRED_TEMPLATE_ID = 118178L;
|
private final static Long WILLBEEXPIRED_TEMPLATE_ID = 118178L;
|
||||||
public static void sendWillBeExpiredEmail(Account account, String senderAddress) {
|
public static void sendWillBeExpiredEmail(Account account, String senderAddress) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ public class CollectionElement implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String md5;
|
private String md5;
|
||||||
|
|
||||||
|
private String gradientString;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
|
|||||||
14
src/main/java/com/ai/da/mapper/primary/entity/Gradient.java
Normal file
14
src/main/java/com/ai/da/mapper/primary/entity/Gradient.java
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package com.ai.da.mapper.primary.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Gradient {
|
||||||
|
private List<GradientItem> gradientList;
|
||||||
|
private int angle;
|
||||||
|
private int selectIndex;
|
||||||
|
private boolean gradientShow;
|
||||||
|
private String colorImg;
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.ai.da.mapper.primary.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class GradientItem {
|
||||||
|
private RGBA rgba;
|
||||||
|
private String left;
|
||||||
|
}
|
||||||
11
src/main/java/com/ai/da/mapper/primary/entity/RGBA.java
Normal file
11
src/main/java/com/ai/da/mapper/primary/entity/RGBA.java
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
package com.ai.da.mapper.primary.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class RGBA {
|
||||||
|
private int r;
|
||||||
|
private int g;
|
||||||
|
private int b;
|
||||||
|
private double a;
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ai.da.model.dto;
|
package com.ai.da.model.dto;
|
||||||
|
|
||||||
|
import com.ai.da.mapper.primary.entity.Gradient;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -25,4 +26,10 @@ public class CollectionColorDTO {
|
|||||||
@ApiModelProperty("潘通RGB值")
|
@ApiModelProperty("潘通RGB值")
|
||||||
private String rgbValue;
|
private String rgbValue;
|
||||||
|
|
||||||
|
private Gradient gradient;
|
||||||
|
|
||||||
|
// private String gradientString;
|
||||||
|
|
||||||
|
private String gradientMinioUrl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ai.da.model.dto;
|
package com.ai.da.model.dto;
|
||||||
|
|
||||||
|
import com.ai.da.mapper.primary.entity.Gradient;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class DesignSingleItemDTO {
|
|||||||
private Integer priority;
|
private Integer priority;
|
||||||
|
|
||||||
@ApiModelProperty("渐变 起始/目标 颜色")
|
@ApiModelProperty("渐变 起始/目标 颜色")
|
||||||
private List<List<Integer>> gradient;
|
private String gradient;
|
||||||
|
|
||||||
@ApiModelProperty("渐变角度")
|
@ApiModelProperty("渐变角度")
|
||||||
private Float gradient_angle;
|
private Float gradient_angle;
|
||||||
|
|||||||
@@ -1548,7 +1548,9 @@ public class PythonService {
|
|||||||
pythonItem.setPath(sysFileVO.getUrl());
|
pythonItem.setPath(sysFileVO.getUrl());
|
||||||
pythonItem.setBusinessId(sysFileVO.getId());
|
pythonItem.setBusinessId(sysFileVO.getId());
|
||||||
if (SysFileLevel2TypeEnum.SHOES.getRealName().equals(type)) {
|
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);
|
designPythonItemBlouse.setPath(path);
|
||||||
//所有的icon都是none
|
//所有的icon都是none
|
||||||
designPythonItemBlouse.setIcon("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")
|
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);
|
||||||
@@ -1937,7 +1941,9 @@ public class PythonService {
|
|||||||
designPythonItemBlouse.setPath(collectionElement.getUrl());
|
designPythonItemBlouse.setPath(collectionElement.getUrl());
|
||||||
//所有的icon都是none
|
//所有的icon都是none
|
||||||
designPythonItemBlouse.setIcon("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")
|
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);
|
||||||
@@ -2216,14 +2222,14 @@ public class PythonService {
|
|||||||
return sysFileVo.get(key.intValue());
|
return sysFileVo.get(key.intValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getRandomColor(List<CollectionColorDTO> colorBoards) {
|
private CollectionColorDTO getRandomColor(List<CollectionColorDTO> colorBoards) {
|
||||||
if (colorBoards.size() == 1) {
|
if (colorBoards.size() == 1) {
|
||||||
return colorBoards.get(0).getRgbValue();
|
return colorBoards.get(0);
|
||||||
}
|
}
|
||||||
long maxColor = colorBoards.size();
|
long maxColor = colorBoards.size();
|
||||||
long minColor = 0;
|
long minColor = 0;
|
||||||
Long randomIndex = RandomsUtil.randomSysFile(minColor, maxColor);
|
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) {
|
private CollectionElement getRandomSketchLibrary(List<CollectionElement> sketchBoardElementOlds, List<String> hasUseMd5List) {
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ public class DesignPythonItem {
|
|||||||
*/
|
*/
|
||||||
private String color;
|
private String color;
|
||||||
|
|
||||||
|
private String gradient;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对应的print图片的绝对路径
|
* 对应的print图片的绝对路径
|
||||||
*/
|
*/
|
||||||
@@ -74,7 +76,7 @@ public class DesignPythonItem {
|
|||||||
*/
|
*/
|
||||||
private Integer priority;
|
private Integer priority;
|
||||||
|
|
||||||
private List<List<Integer>> gradient;
|
// private List<List<Integer>> gradient;
|
||||||
|
|
||||||
private Float gradient_angle;
|
private Float gradient_angle;
|
||||||
|
|
||||||
@@ -126,7 +128,7 @@ public class DesignPythonItem {
|
|||||||
this.priority = priority;
|
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.type = type;
|
||||||
this.path = path;
|
this.path = path;
|
||||||
this.color = color;
|
this.color = color;
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import org.springframework.util.StringUtils;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -76,6 +77,8 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
|
|
||||||
@Value("${minio.bucketName.collectionElement}")
|
@Value("${minio.bucketName.collectionElement}")
|
||||||
private String collectionElement;
|
private String collectionElement;
|
||||||
|
@Value("${minio.bucketName.gradient}")
|
||||||
|
private String gradientBucketName;
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
@@ -348,7 +351,17 @@ 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();
|
||||||
|
for (CollectionColorDTO colorBoard : colorBoards) {
|
||||||
|
String colorImg = colorBoard.getGradient().getColorImg();
|
||||||
|
String[] parts = colorImg.split(",");
|
||||||
|
String imageType = parts[0].split("/")[1].split(";")[0];
|
||||||
|
String base64Data = parts[1];
|
||||||
|
String gradientMinioUrl = minioUtil.uploadImageFromBase64(gradientBucketName, base64Data, imageType);
|
||||||
|
colorBoard.setGradientMinioUrl(gradientMinioUrl);
|
||||||
|
colorBoard.getGradient().setColorImg(null);
|
||||||
|
}
|
||||||
|
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();
|
||||||
@@ -767,7 +780,8 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
element.setColorRgb(color.getRgbValue());
|
element.setColorRgb(color.getRgbValue());
|
||||||
//按时区计算
|
//按时区计算
|
||||||
element.setCreateDate(DateUtil.getByTimeZone(timeZone));
|
element.setCreateDate(DateUtil.getByTimeZone(timeZone));
|
||||||
|
color.getGradient().setColorImg(null);
|
||||||
|
element.setGradientString(JSON.toJSONString(color.getGradient()));
|
||||||
elements.add(element);
|
elements.add(element);
|
||||||
});
|
});
|
||||||
return elements;
|
return elements;
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ minio.bucketName.results=aida-results
|
|||||||
minio.bucketName.sysImage=aida-sys-image
|
minio.bucketName.sysImage=aida-sys-image
|
||||||
minio.bucketName.users=aida-users
|
minio.bucketName.users=aida-users
|
||||||
minio.bucketName.collectionElement=aida-collection-element
|
minio.bucketName.collectionElement=aida-collection-element
|
||||||
|
minio.bucketName.gradient=aida-gradient
|
||||||
redirect_url=http://18.167.251.121:7788
|
redirect_url=http://18.167.251.121:7788
|
||||||
|
|
||||||
spring.rabbitmq.host=18.167.251.121
|
spring.rabbitmq.host=18.167.251.121
|
||||||
|
|||||||
Reference in New Issue
Block a user