Merge remote-tracking branch 'origin/dev/3.1_release_merge' into dev-ltx
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -48,3 +48,4 @@ log
|
||||
temp/
|
||||
|
||||
docker-compose.yml
|
||||
/src/main/resources/application-local.properties
|
||||
|
||||
@@ -22,6 +22,9 @@ public class GenerateLikeDTO {
|
||||
@ApiModelProperty("当一级类型为Sketchboard时,二级类型 Outwear Dress Blouse Skirt Trousers;当一级类型为Printboard时,二级类型 Slogan Logo Pattern")
|
||||
private String level2Type;
|
||||
|
||||
@ApiModelProperty("年龄段")
|
||||
private String ageGroup;
|
||||
|
||||
@ApiModelProperty("性别")
|
||||
private String gender;
|
||||
|
||||
|
||||
@@ -4092,9 +4092,11 @@ public class PythonService {
|
||||
content.put("pose_id", String.valueOf(poseId));
|
||||
RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(content));
|
||||
|
||||
log.info("poseTransformation 请求地址: {}", accessPythonIp + ":" + accessPythonPort + "/api/pose_transform");
|
||||
// String uri = "/api/pose_transform";
|
||||
String uri = "/api/comfyui_pose_transform";
|
||||
log.info("poseTransformation 请求地址: {}", accessPythonIp + ":" + accessPythonPort + uri);
|
||||
Request request = new Request.Builder()
|
||||
.url(accessPythonIp + ":" + accessPythonPort + "/api/pose_transform")
|
||||
.url(accessPythonIp + ":" + accessPythonPort + uri)
|
||||
.method("POST", body)
|
||||
.addHeader("Content-Type", "application/json")
|
||||
.build();
|
||||
|
||||
@@ -173,7 +173,7 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
|
||||
affiliate.setLink(CommonConstant.AFFILIATE_LINK + affiliate.getId());
|
||||
if (Objects.isNull(commission)) {
|
||||
// 未设置佣金比例的情况下,默认25%
|
||||
affiliate.setCommissionPercent(25f);
|
||||
affiliate.setCommissionPercent(20f);
|
||||
} else {
|
||||
affiliate.setCommissionPercent(commission);
|
||||
}
|
||||
|
||||
@@ -227,8 +227,8 @@ public class CollectionSortServiceImpl extends ServiceImpl<CollectionSortMapper,
|
||||
}
|
||||
child.setSort(collectionSort.getSort());
|
||||
// 原来排序的大于等于userLikeSortId的排序的,都要+1
|
||||
// baseMapper.increaseGenerateSortAbove(parentId, /*relationType,*/ collectionSort.getSort() - 1);
|
||||
resort(collectionSort.getProjectId(), parentId);
|
||||
baseMapper.increaseGenerateSortAbove(parentId, /*relationType,*/ collectionSort.getSort() - 1);
|
||||
// resort(collectionSort.getProjectId(), parentId);
|
||||
// 当前的生成结果则填入userLikeSortId的排序位置
|
||||
child.setUpdateTime(LocalDateTime.now());
|
||||
baseMapper.updateById(child);
|
||||
@@ -269,13 +269,17 @@ public class CollectionSortServiceImpl extends ServiceImpl<CollectionSortMapper,
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void resort(Long projectId, Long parentId) {
|
||||
|
||||
LambdaQueryWrapper<CollectionSort> wrapper = new LambdaQueryWrapper<CollectionSort>()
|
||||
.eq(CollectionSort::getProjectId, projectId)
|
||||
.orderByAsc(CollectionSort::getSort);
|
||||
|
||||
if (parentId != null) {
|
||||
wrapper.eq(CollectionSort::getParentId, parentId);
|
||||
} else {
|
||||
wrapper.isNull(CollectionSort::getParentId);
|
||||
}
|
||||
// 2. 查询同组数据,按原排序升序
|
||||
List<CollectionSort> list = baseMapper.selectList(
|
||||
new LambdaQueryWrapper<CollectionSort>()
|
||||
.eq(CollectionSort::getProjectId, projectId)
|
||||
.eq(CollectionSort::getParentId, parentId)
|
||||
.orderByAsc(CollectionSort::getSort)
|
||||
);
|
||||
List<CollectionSort> list = baseMapper.selectList(wrapper);
|
||||
|
||||
// 3. 重新编号 sort,从 1 开始
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
|
||||
@@ -827,9 +827,7 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
|
||||
Long accountId = UserContext.getUserHolder().getId();
|
||||
Account account = accountService.getById(accountId);
|
||||
// 允许查看数据的用户id
|
||||
if (!ADMIN_IDS.contains(account.getId())
|
||||
&& !ADMIN_IDS_READ_ONLY.contains(account.getId())
|
||||
) {
|
||||
if (!ADMIN_IDS.contains(account.getId())) {
|
||||
throw new BusinessException("have.no.permission", ResultEnum.PROMPT.getCode());
|
||||
}
|
||||
Integer size = queryPaymentInfoDTO.getSize();
|
||||
@@ -896,9 +894,7 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
|
||||
Long accountId = UserContext.getUserHolder().getId();
|
||||
Account account = accountService.getById(accountId);
|
||||
// 允许查看数据的用户id
|
||||
if (!ADMIN_IDS.contains(account.getId())
|
||||
&& !ADMIN_IDS_READ_ONLY.contains(account.getId())
|
||||
) {
|
||||
if (!ADMIN_IDS.contains(account.getId())) {
|
||||
throw new BusinessException("have.no.permission", ResultEnum.PROMPT.getCode());
|
||||
}
|
||||
// 查询数据总量
|
||||
|
||||
@@ -521,7 +521,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
// 2.2、添加到library
|
||||
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
||||
Long accountId = userInfo.getId();
|
||||
Library library = setLibrary(accountId, generateLikeDTO, generateDetail.getUrl());
|
||||
Library library = setLibrary(accountId, generateLikeDTO, generateDetail.getUrl(), generateLikeDTO.getAgeGroup());
|
||||
libraryService.save(library);
|
||||
|
||||
// 3、更新generateDetail表的isLike列和libraryId列
|
||||
@@ -555,12 +555,13 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
public Library setLibrary(Long accountId, GenerateLikeDTO generateLikeDTO, String imageUrl) {
|
||||
public Library setLibrary(Long accountId, GenerateLikeDTO generateLikeDTO, String imageUrl, String ageGroup) {
|
||||
Library library = new Library();
|
||||
library.setAccountId(accountId);
|
||||
library.setLevel1Type(generateLikeDTO.getLevel1Type());
|
||||
library.setLevel2Type(StringUtil.isNullOrEmpty(generateLikeDTO.getLevel2Type()) ? null : generateLikeDTO.getLevel2Type());
|
||||
library.setLevel3Type(StringUtil.isNullOrEmpty(generateLikeDTO.getGender()) ? null : generateLikeDTO.getGender());
|
||||
library.setAgeGroup(ageGroup);
|
||||
library.setName(DateUtil.getTimeStamp(generateLikeDTO.getTimeZone()) + "_N_G");
|
||||
library.setUrl(imageUrl);
|
||||
try {
|
||||
@@ -2554,7 +2555,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
if (Objects.nonNull(poseTransformDTO.getParentId())
|
||||
&& !poseTransformDTO.getParentId().equals(0L)) {
|
||||
return disOrLikePose(poseTransformationId, "like",
|
||||
poseTransformDTO.getProjectId(), poseTransformDTO.getParentId());
|
||||
poseTransformDTO.getProjectId(), poseTransformDTO.getUserLikeSortId());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import io.netty.util.internal.StringUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -224,6 +225,7 @@ public class PaymentInfoServiceImpl extends ServiceImpl<PaymentInfoMapper, Payme
|
||||
|
||||
@Value("${stripe.private-key}")
|
||||
private String privateKey;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public PaymentInfo createOrUpdatePaymentInfoForStripe(Invoice invoice){
|
||||
Stripe.apiKey = privateKey;
|
||||
// 获取transactionId,从sessionId更改为invoiceId
|
||||
|
||||
@@ -351,6 +351,9 @@ public class StripeServiceImpl implements StripeService {
|
||||
}
|
||||
} else if (event.getType().equals("customer.subscription.deleted")){
|
||||
SubscriptionInfo subscriptionInfo = updateSubscription(subscription);
|
||||
if (Objects.isNull(subscriptionInfo)){
|
||||
return true;
|
||||
}
|
||||
log.info("用户 {} 取消连续订阅 {}", subscriptionInfo.getAccountId(), subscription.getId());
|
||||
if (subscriptionInfo.getCancelNotified() == (byte)0){
|
||||
log.info("取消订阅 邮件通知商家");
|
||||
@@ -571,6 +574,10 @@ public class StripeServiceImpl implements StripeService {
|
||||
String description = subscription.getDescription();
|
||||
String orderNo = description.replace("AiDA - ", "");
|
||||
OrderInfo orderInfo = orderInfoService.getOrderByOrderNo(orderNo);
|
||||
if (Objects.isNull(orderInfo)){
|
||||
log.warn("未知订阅:{}", subscription.getId());
|
||||
return null;
|
||||
}
|
||||
|
||||
// 从回调信息中获取recurring type
|
||||
SubscriptionItem subscriptionItem = subscription.getItems().getData().get(0);
|
||||
@@ -1002,9 +1009,14 @@ public class StripeServiceImpl implements StripeService {
|
||||
|
||||
public boolean sendEmail(String subscriptionId, String type, String orderNo) {
|
||||
SubscriptionInfo subscriptionInfo;
|
||||
long secondsTimestamp = System.currentTimeMillis() / 1000;
|
||||
log.info("当前时间戳:{}", secondsTimestamp);
|
||||
QueryWrapper<SubscriptionInfo> qwSI = new QueryWrapper<>();
|
||||
if (!StringUtil.isNullOrEmpty(subscriptionId)) {
|
||||
qwSI.eq("subscription_id", subscriptionId);
|
||||
// 区分当前订阅的时段,从而确定是新订单还是续订订单的记录
|
||||
qwSI.lambda().eq(SubscriptionInfo::getSubscriptionId, subscriptionId)
|
||||
.lt(SubscriptionInfo::getCurrentPeriodStart, secondsTimestamp)
|
||||
.gt(SubscriptionInfo::getCurrentPeriodEnd, secondsTimestamp);
|
||||
List<SubscriptionInfo> subscriptionInfoList = subscriptionInfoMapper.selectList(qwSI);
|
||||
|
||||
if (subscriptionInfoList.isEmpty()){
|
||||
@@ -1024,7 +1036,9 @@ public class StripeServiceImpl implements StripeService {
|
||||
}
|
||||
}
|
||||
}else if (!StringUtil.isNullOrEmpty(orderNo)) {
|
||||
qwSI.eq("order_no", orderNo);
|
||||
qwSI.lambda().eq(SubscriptionInfo::getOrderNo, orderNo)
|
||||
.lt(SubscriptionInfo::getCurrentPeriodStart, secondsTimestamp)
|
||||
.gt(SubscriptionInfo::getCurrentPeriodEnd, secondsTimestamp);
|
||||
subscriptionInfo = subscriptionInfoMapper.selectOne(qwSI);
|
||||
if (Objects.isNull(subscriptionInfo)){
|
||||
log.info("不发送邮件,原因:【根据order_no:{},查询到的subscriptionInfo为空】", orderNo);
|
||||
@@ -1036,7 +1050,12 @@ public class StripeServiceImpl implements StripeService {
|
||||
}
|
||||
|
||||
QueryWrapper<PaymentInfo> qwPI = new QueryWrapper<>();
|
||||
qwPI.eq("order_no", subscriptionInfo.getOrderNo()).orderByDesc("id");
|
||||
String periodStart = DateUtil.changeTimeStampFormat(subscriptionInfo.getCurrentPeriodStart(), "seconds", CommonConstant.TIME_FORMAT_yyyy_MM_dd_HH_mm_ss);
|
||||
String periodEnd = DateUtil.changeTimeStampFormat(subscriptionInfo.getCurrentPeriodEnd(), "seconds", CommonConstant.TIME_FORMAT_yyyy_MM_dd_HH_mm_ss);
|
||||
|
||||
qwPI.lambda().eq(PaymentInfo::getOrderNo, subscriptionInfo.getOrderNo())
|
||||
.between(PaymentInfo::getCreateTime, periodStart, periodEnd)
|
||||
.orderByDesc(PaymentInfo::getId);
|
||||
List<PaymentInfo> paymentInfos = paymentInfoMapper.selectList(qwPI);
|
||||
if (paymentInfos.isEmpty()) {
|
||||
log.info("不发送邮件,原因:【根据order_no:{},查询到的paymentInfos为空】", orderNo);
|
||||
|
||||
Reference in New Issue
Block a user