Merge branch 'release/3.0' into dev/dev_xp
# Conflicts: # src/main/java/com/ai/da/python/PythonService.java # src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java
This commit is contained in:
@@ -12,16 +12,16 @@ public class MQConfig {
|
||||
// public static final String GENERATE_QUEUE = "generate-queue-test";
|
||||
// ==================================================================
|
||||
// public static final String GENERATE_QUEUE = "generate-queue-local";
|
||||
public static final String GENERATE_QUEUE = "generate-queue-dev";
|
||||
public static final String GENERATE_QUEUE = "generate-queue-prod";
|
||||
|
||||
// public static final String SR_QUEUE = "SR-queue-local";
|
||||
public static final String SR_QUEUE = "SR-queue-dev";
|
||||
public static final String SR_QUEUE = "SR-queue-prod";
|
||||
|
||||
// public static final String SR_RESULT_QUEUE = "SuperResolution-local";
|
||||
public static final String SR_RESULT_QUEUE = "SuperResolution-dev";
|
||||
public static final String SR_RESULT_QUEUE = "SuperResolution-prod";
|
||||
|
||||
// public static final String GENERATE_RESULT_QUEUE = "GenerateImage-local";
|
||||
public static final String GENERATE_RESULT_QUEUE = "GenerateImage-dev";
|
||||
public static final String GENERATE_RESULT_QUEUE = "GenerateImage-prod";
|
||||
|
||||
public MQConfig() {
|
||||
}
|
||||
|
||||
@@ -218,17 +218,17 @@ public class SRConsumer {
|
||||
taskListService.updateTaskStatusOrOutputRedis(uniqueId, "fail", null);
|
||||
}
|
||||
|
||||
// @RabbitListener(queues = MQConfig.SR_QUEUE)
|
||||
// @RabbitHandler
|
||||
// public void SRConsumer1(Message msg, Channel channel) {
|
||||
// superResolution(msg, channel, "consumer 1");
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @RabbitListener(queues = MQConfig.SR_RESULT_QUEUE)
|
||||
// @RabbitHandler
|
||||
// public void SRResultConsumer1(Message msg, Channel channel) {
|
||||
// getSRResult(msg, channel, "consumer 1");
|
||||
// }
|
||||
@RabbitListener(queues = MQConfig.SR_QUEUE)
|
||||
@RabbitHandler
|
||||
public void SRConsumer1(Message msg, Channel channel) {
|
||||
superResolution(msg, channel, "consumer 1");
|
||||
}
|
||||
|
||||
|
||||
@RabbitListener(queues = MQConfig.SR_RESULT_QUEUE)
|
||||
@RabbitHandler
|
||||
public void SRResultConsumer1(Message msg, Channel channel) {
|
||||
getSRResult(msg, channel, "consumer 1");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class MyTaskScheduler {
|
||||
|
||||
// 定时任务,每十五天执行一次
|
||||
// @Scheduled(cron = "0 0 0 ? * MON")
|
||||
// @Scheduled(cron = "0 0 0 */15 * ?")
|
||||
@Scheduled(cron = "0 0 0 */15 * ?")
|
||||
public void checkExpiry() {
|
||||
// 检测正式用户是否快要过期
|
||||
QueryWrapper<Account> qw = new QueryWrapper<>();
|
||||
@@ -68,7 +68,7 @@ public class MyTaskScheduler {
|
||||
}
|
||||
}
|
||||
}
|
||||
// @Scheduled(cron = "0 0 8 * * ?")
|
||||
@Scheduled(cron = "0 0 8 * * ?")
|
||||
public void sendTrialOrderExcelToManagements() {
|
||||
// 获取前一天日期
|
||||
LocalDate yesterday = LocalDate.now().minusDays(1);
|
||||
|
||||
@@ -23,7 +23,7 @@ public class PaypalTask {
|
||||
@Resource
|
||||
private PayPalCheckoutService payPalCheckoutService;
|
||||
|
||||
// @Scheduled(cron = "0/30 * * * * ?")
|
||||
@Scheduled(cron = "0/30 * * * * ?")
|
||||
public void orderConfirm() throws SerializeException {
|
||||
|
||||
log.info("PayPal orderConfirm 被执行......");
|
||||
|
||||
@@ -136,7 +136,7 @@ public class SendEmailUtil {
|
||||
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, boolean link) {
|
||||
try {
|
||||
// 实例化一个认证对象
|
||||
Credential cred = new Credential(SECRET_ID, SECRET_KEy);
|
||||
@@ -173,7 +173,7 @@ public class SendEmailUtil {
|
||||
}else {
|
||||
template.setTemplateID(NOTIFICATION_TEMPLATE_ID);
|
||||
}
|
||||
template.setTemplateData(buildNotificationData(trialOrder));
|
||||
template.setTemplateData(buildNotificationData(trialOrder, link));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -345,7 +345,7 @@ public class SendEmailUtil {
|
||||
}
|
||||
|
||||
// 构建试用订单通过通知数据
|
||||
private static String buildNotificationData(TrialOrder trialOrder) {
|
||||
private static String buildNotificationData(TrialOrder trialOrder, boolean link) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
// 设置试用订单通过通知相关数据
|
||||
jsonObject.put("title", trialOrder.getTitle());
|
||||
@@ -353,6 +353,11 @@ public class SendEmailUtil {
|
||||
jsonObject.put("givenName", trialOrder.getGivenName());
|
||||
jsonObject.put("userName", trialOrder.getUserName());
|
||||
jsonObject.put("email", trialOrder.getEmail());
|
||||
if (link) {
|
||||
jsonObject.put("days", 14);
|
||||
}else {
|
||||
jsonObject.put("days", 5);
|
||||
}
|
||||
return jsonObject.toJSONString();
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ public class CollectionElement implements Serializable {
|
||||
*/
|
||||
private String md5;
|
||||
|
||||
private String gradientString;
|
||||
// private String gradientString;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
|
||||
@@ -64,7 +64,7 @@ public class DesignItemDetail implements Serializable {
|
||||
*/
|
||||
private String color;
|
||||
|
||||
private String gradientString;
|
||||
// private String gradientString;
|
||||
|
||||
/**
|
||||
* 对应的print图片的绝对路径
|
||||
|
||||
@@ -26,10 +26,10 @@ public class CollectionColorDTO {
|
||||
@ApiModelProperty("潘通RGB值")
|
||||
private String rgbValue;
|
||||
|
||||
private Gradient gradient;
|
||||
// private Gradient gradient;
|
||||
//
|
||||
// private String gradientString;
|
||||
|
||||
private String gradientString;
|
||||
|
||||
private String gradientMinioUrl;
|
||||
// private String gradientMinioUrl;
|
||||
|
||||
}
|
||||
|
||||
@@ -50,8 +50,8 @@ public class DesignSingleItemDTO implements Serializable {
|
||||
@ApiModelProperty("图层优先级")
|
||||
private Integer priority;
|
||||
|
||||
@ApiModelProperty("渐变 颜色")
|
||||
private Gradient gradient;
|
||||
// @ApiModelProperty("渐变 颜色")
|
||||
// private Gradient gradient;
|
||||
|
||||
@ApiModelProperty("画笔修改过的sketch图片的base64格式的数据")
|
||||
private String sketchString;
|
||||
|
||||
@@ -28,9 +28,9 @@ public class DesignPythonItem {
|
||||
*/
|
||||
private String color;
|
||||
|
||||
private String gradient;
|
||||
// private String gradient;
|
||||
|
||||
private String gradientString;
|
||||
// private String gradientString;
|
||||
|
||||
/**
|
||||
* 对应的print图片的绝对路径
|
||||
@@ -114,7 +114,7 @@ public class DesignPythonItem {
|
||||
}
|
||||
|
||||
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, String gradientString) {
|
||||
Long image_id, List<Long> offset, Float[] resize_scale, Integer priority) {
|
||||
this.type = type;
|
||||
this.path = path;
|
||||
this.color = color;
|
||||
@@ -125,8 +125,8 @@ public class DesignPythonItem {
|
||||
this.offset = offset;
|
||||
this.resize_scale = resize_scale;
|
||||
this.priority = priority;
|
||||
this.gradient = gradient;
|
||||
this.gradientString = gradientString;
|
||||
// this.gradient = gradient;
|
||||
// this.gradientString = gradientString;
|
||||
}
|
||||
|
||||
public DesignPythonItem(String type, String path, String color, DesignPythonItemPrint print, String icon, Long businessId, Long image_id) {
|
||||
|
||||
@@ -184,7 +184,6 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
}
|
||||
|
||||
private void validateUserValidaExpire(Account account) {
|
||||
|
||||
Long currentTime = new Date().getTime();
|
||||
if (Objects.nonNull(account.getValidStartTime())) {
|
||||
if (currentTime < account.getValidStartTime()) {
|
||||
@@ -469,6 +468,10 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
public Boolean addTrialUser(AccountTrialDTO accountTrialDTO, HttpServletRequest request) {
|
||||
// 获取用户申请试用IP
|
||||
String ipAddress = RequestInfoUtil.getIpAddress(request);
|
||||
boolean link = false;
|
||||
if (StringUtils.isNotBlank(accountTrialDTO.getRef())) {
|
||||
link = true;
|
||||
}
|
||||
// 先检测试用订单
|
||||
QueryWrapper<TrialOrder> trialOrderQueryWrapper = new QueryWrapper<>();
|
||||
trialOrderQueryWrapper.eq("BINARY email", accountTrialDTO.getEmail());
|
||||
@@ -516,7 +519,8 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
account.setIsTrial(1);
|
||||
account.setIsBeginner(1);
|
||||
account.setValidStartTime(System.currentTimeMillis());
|
||||
if (StringUtils.isNotBlank(accountTrialDTO.getRef())) {
|
||||
|
||||
if (link) {
|
||||
account.setValidEndTime(Instant.now().plus(14, ChronoUnit.DAYS).toEpochMilli());
|
||||
}else {
|
||||
account.setValidEndTime(Instant.now().plus(5, ChronoUnit.DAYS).toEpochMilli());
|
||||
@@ -528,7 +532,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
account.setUserEmail(trialOrder.getEmail());
|
||||
account.setLanguage(Language.ENGLISH.name());
|
||||
account.setValidStartTime(System.currentTimeMillis());
|
||||
if (StringUtils.isNotBlank(accountTrialDTO.getRef())) {
|
||||
if (link) {
|
||||
account.setValidEndTime(Instant.now().plus(14, ChronoUnit.DAYS).toEpochMilli());
|
||||
}else {
|
||||
account.setValidEndTime(Instant.now().plus(5, ChronoUnit.DAYS).toEpochMilli());
|
||||
@@ -543,9 +547,9 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
// SendEmailUtil.sendCustomEmail("calvinwong@aidlab.hk", null, trialOrder,2);
|
||||
// SendEmailUtil.sendCustomEmail("kaicpang.pang@connect.polyu.hk", null, trialOrder,2);
|
||||
if (trialOrder.getCountry().equals("China")) {
|
||||
SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry());
|
||||
SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry(), link);
|
||||
}else {
|
||||
SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry());
|
||||
SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry(), link);
|
||||
}
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
@@ -595,9 +599,9 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
// SendEmailUtil.sendCustomEmail("calvinwong@aidlab.hk", null, trialOrder,2, trialOrder.getCountry());
|
||||
// SendEmailUtil.sendCustomEmail("kaicpang.pang@connect.polyu.hk", null, trialOrder,2, trialOrder.getCountry());
|
||||
if (trialOrder.getCountry().equals("China")) {
|
||||
SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry());
|
||||
SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry(), false);
|
||||
}else {
|
||||
SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry());
|
||||
SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry(), false);
|
||||
}
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
|
||||
@@ -351,20 +351,20 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
||||
@Override
|
||||
public ValidateElementVO validateElement(DesignCollectionDTO designDTO) {
|
||||
ValidateElementVO elementVO = CopyUtil.copyObject(designDTO, ValidateElementVO.class);
|
||||
List<CollectionColorDTO> colorBoards = elementVO.getColorBoards();
|
||||
for (CollectionColorDTO colorBoard : colorBoards) {
|
||||
if (Objects.nonNull(colorBoard.getGradient())) {
|
||||
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);
|
||||
colorBoard.setGradientString(JSON.toJSONString(colorBoard.getGradient()));
|
||||
}
|
||||
}
|
||||
elementVO.setColorBoards(colorBoards);
|
||||
// List<CollectionColorDTO> colorBoards = elementVO.getColorBoards();
|
||||
// for (CollectionColorDTO colorBoard : colorBoards) {
|
||||
// if (Objects.nonNull(colorBoard.getGradient())) {
|
||||
// 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);
|
||||
// colorBoard.setGradientString(JSON.toJSONString(colorBoard.getGradient()));
|
||||
// }
|
||||
// }
|
||||
// elementVO.setColorBoards(colorBoards);
|
||||
List<Long> usedElementIds = elementVO.getUsedElementIds();
|
||||
List<CollectionElement> libraryCollectionElements = elementVO.getLibraryCollectionElements();
|
||||
List<CollectionElement> generateCollectionElements = elementVO.getGenerateCollectionElements();
|
||||
@@ -783,10 +783,10 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
||||
element.setColorRgb(color.getRgbValue());
|
||||
//按时区计算
|
||||
element.setCreateDate(DateUtil.getByTimeZone(timeZone));
|
||||
if (Objects.nonNull(color.getGradient())) {
|
||||
color.getGradient().setColorImg(null);
|
||||
}
|
||||
element.setGradientString(JSON.toJSONString(color.getGradient()));
|
||||
// if (Objects.nonNull(color.getGradient())) {
|
||||
// color.getGradient().setColorImg(null);
|
||||
// }
|
||||
// element.setGradientString(JSON.toJSONString(color.getGradient()));
|
||||
elements.add(element);
|
||||
});
|
||||
return elements;
|
||||
|
||||
@@ -998,7 +998,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
d.setPath(minioUtil.getPresignedUrl(o.getPath(), 24 * 60));
|
||||
d.setMinIOPath(o.getPath());
|
||||
d.setLevel1Type(converTypeToLevel1(o.getType()));
|
||||
d.setGradient(JSONObject.parseObject(o.getGradientString(), Gradient.class));
|
||||
// d.setGradient(JSONObject.parseObject(o.getGradientString(), Gradient.class));
|
||||
// 根据designItemDetailId获取印花
|
||||
List<DesignItemDetailPrint> prints = designItemDetailPrintService.getByDesignItemDetailId(o.getId());
|
||||
// 判断有无印花
|
||||
|
||||
Reference in New Issue
Block a user