TASK:1.订阅成功和续签成功,通知商家的邮件中添加邮件和国家 2.在getModuleContent的回参中添加motion相关数据 3.修改Affiliate账号状态与修改佣金比例接口合并

This commit is contained in:
2025-11-14 14:51:30 +08:00
parent ef84f32ca0
commit 88ce191950
12 changed files with 64 additions and 46 deletions

View File

@@ -24,7 +24,7 @@ public interface AffiliateService extends IService<Affiliate> {
Boolean applicationApproval(Long id, Boolean isApproved, Float commission);
void updateCommissionPercentage(Long id, Float commission);
void editAffiliate(Long id, Float commission, String operationType);
void updateAffiliateInfoWithPayment();
@@ -41,6 +41,4 @@ public interface AffiliateService extends IService<Affiliate> {
void calcCouponsCommission();
List<Map<String, Object>> getAllAffiliateUsername();
void modifyAffiliateStatus(Long affiliateId, String operationType);
}

View File

@@ -35,6 +35,8 @@ public interface StripeService {
Map<String, String> getPaymentMethod(String paymentMethodId);
boolean sendEmail(String subscriptionId, String type, String orderNo);
/*void updateSubscription(String subscriptionId);
void resume(String subscriptionId);*/

View File

@@ -50,7 +50,7 @@ public interface UserLikeGroupService extends IService<UserLikeGroup> {
void toProduct(String taskId);
ToProductElementVO toProductImageElementUpload(MultipartFile file, Long projectId);
ToProductElementVO toProductImageElementUpload(MultipartFile file, Long projectId, String type);
CollectionSort productImageLike(ProductImageLikeDTO productImageLikeDTO);

View File

@@ -200,7 +200,7 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
return true;
}
public void updateCommissionPercentage(Long id, Float commission){
public void editAffiliate(Long id, Float commission, String operationType){
Affiliate affiliate = baseMapper.selectById(id);
if (Objects.isNull(affiliate)){
log.info("未知affiliate id :{}", id);
@@ -208,9 +208,21 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
}
if (!Objects.equals(affiliate.getCommissionPercent(), commission)){
affiliate.setCommissionPercent(commission);
affiliate.setUpdateTime(LocalDateTime.now());
baseMapper.updateById(affiliate);
}
// operationType Active -> 激活 | Inactive -> 关闭 | Delete -> 删除
if (!StringUtil.isNullOrEmpty(operationType)) {
if (operationType.equals("Delete")) {
baseMapper.deleteById(id);
return;
} else if (operationType.equals("Active") || operationType.equals("Inactive")) {
affiliate.setStatus(operationType);
} else {
throw new BusinessException("unknown.operationType");
}
}
affiliate.setUpdateTime(LocalDateTime.now());
baseMapper.updateById(affiliate);
}
// 定时计算佣金
@@ -554,23 +566,4 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
coupon.setUnpaidCommission(unpaidCommission);
}
// operationType Active -> 激活 | Inactive -> 关闭 | Delete -> 删除
@Override
public void modifyAffiliateStatus(Long affiliateId, String operationType) {
Affiliate affiliate = baseMapper.selectById(affiliateId);
if (Objects.isNull(affiliate)) {
throw new BusinessException("unknow.affiliate");
}
if (operationType.equals("Delete")) {
affiliate.setIsDeleted(1);
} else if (operationType.equals("Active") || operationType.equals("Inactive")) {
affiliate.setStatus(operationType);
} else {
throw new BusinessException("unknown.operationType");
}
updateById(affiliate);
}
}

View File

@@ -2673,11 +2673,16 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
vo = CopyUtil.copyObject(dbItem, PoseTransformationVO.class);
vo.setTaskId(taskId);
// 设置产品图片URL
// 设置产品图片URL(首帧)
if (dbItem.getProductImage() != null) {
vo.setProductImage(minioUtil.getPreSignedUrl(
dbItem.getProductImage(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
}
// 设置产品图片URL(尾帧)
if (dbItem.getLastFrameProductImage() != null) {
vo.setLastFrameProductImage(minioUtil.getPreSignedUrl(
dbItem.getLastFrameProductImage(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
}
// 如果视频URL为空直接返回
if (StringUtil.isNullOrEmpty(dbItem.getVideoUrl())) {

View File

@@ -1085,6 +1085,8 @@ public class StripeServiceImpl implements StripeService {
SubscriptionEmailParamsDTO emailParamsDTO = new SubscriptionEmailParamsDTO();
emailParamsDTO.setUsername(userName);
emailParamsDTO.setEmail(account.getUserEmail());
emailParamsDTO.setCountry(paymentInfo.getCountry());
emailParamsDTO.setOrderId(paymentInfo.getId().toString());
emailParamsDTO.setOrderRef("\"" + orderListLink + paymentInfo.getId().toString() + "\"");
emailParamsDTO.setCreateDate(String.valueOf(paymentInfo.getCreateTime()).replace("T", " "));

View File

@@ -739,7 +739,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
@Override
@Transactional(rollbackFor = Exception.class)
public ToProductElementVO toProductImageElementUpload(MultipartFile file, Long projectId) {
public ToProductElementVO toProductImageElementUpload(MultipartFile file, Long projectId, String type) {
if (null == file || StringUtils.isEmpty(file.getOriginalFilename())) {
throw new BusinessException("file.cannot.be.empty");
}
@@ -754,7 +754,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
// toProductElement.setUserLikeGroupId(userLikeGroupId);
toProductElement.setProjectId(projectId);
toProductElement.setCreateTime(LocalDateTime.now());
// toProductElement.setType(type);
toProductElement.setFrameType(type);
toProductElementMapper.insert(toProductElement);
ToProductElementVO toProductElementVO = CopyUtil.copyObject(toProductElement, ToProductElementVO.class);
toProductElementVO.setMinioUrl(toProductElementVO.getUrl());
@@ -2286,6 +2286,8 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
poseTransformationVO.setId(item.getId());
poseTransformationVO.setTaskId(item.getUniqueId());
poseTransformationVO.setProductImage(getMinioUrl(item.getProductImage()));
poseTransformationVO.setLastFrameProductImage(getMinioUrl(item.getLastFrameProductImage()));
poseTransformationVO.setPrompt(item.getPrompt());
poseTransformationVO.setGifUrl(getMinioUrl(item.getGifUrl()));
poseTransformationVO.setVideoUrl(getMinioUrl(item.getVideoUrl()));
poseTransformationVO.setFirstFrameUrl(getMinioUrl(item.getFirstFrameUrl()));