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:
@@ -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