Merge remote-tracking branch 'origin/dev/dev' into dev/dev

This commit is contained in:
shahaibo
2025-02-11 10:25:08 +08:00
19 changed files with 79 additions and 45 deletions

View File

@@ -53,7 +53,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<>();
@@ -87,7 +87,7 @@ public class MyTaskScheduler {
}
}
}
@Scheduled(cron = "0 0 9 * * ?")
// @Scheduled(cron = "0 0 9 * * ?")
public void sendTrialOrderExcelToManagements() {
// 获取前一天日期
LocalDate yesterday = LocalDate.now().minusDays(1);

View File

@@ -25,20 +25,20 @@ public class AccountTask {
* 每个月月初只刷新年付用户的积分
*/
// @Scheduled(cron = "59 59 23 * * ?")
@Scheduled(cron = "0 0 0 1 * ?")
// @Scheduled(cron = "0 0 0 1 * ?")
public void refreshCreditsMonthly() {
log.info("每月1号0点 将年费用户积分重置为 6000");
accountService.refreshCreditsWeekly();
}
@Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
// @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
public void getPaidUser() {
// 获取code-create 表中 指定日期之后 订单状态为wc-processing的订单
accountService.extendValidityForCC();
}
// 每天凌晨0点执行一次
@Scheduled(cron = "0 0 0 * * ?")
// @Scheduled(cron = "0 0 0 * * ?")
public void cancelActivityBenefits() {
// 1、查询当前所有参与了活动且过期的用户
List<Account> accountList = accountService.getExpiredUserBySystemUser(4);
@@ -51,7 +51,7 @@ public class AccountTask {
}
// 每天检测正式用户到期情况每天凌晨0点执行
@Scheduled(cron = "0 0 0 * * ?")
// @Scheduled(cron = "0 0 0 * * ?")
public void paidUserToVisitor() {
// 1、查询当前已过期正式用户或试用用户
List<Account> accountList = accountService.getExpiredUserBySystemUser(1);
@@ -68,12 +68,12 @@ public class AccountTask {
/**
* 将Code-Create上注册的用户添加为AiDA的游客
*/
@Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
// @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
public void registerUserToVisitor() {
accountService.registerUserToVisitor();
}
@Scheduled(cron = "0 0 0 1 * ?")
// @Scheduled(cron = "0 0 0 1 * ?")
// 每月初刷新所有用户用户名剩余修改次数
public void resetUsernameModifyTimes(){
log.info("重置所有用户的用户名修改次数");

View File

@@ -45,7 +45,7 @@ public class PaymentTask {
@Resource
private PayPalCheckoutService payPalCheckoutService;
@Scheduled(cron = "0/30 * * * * ?")
// @Scheduled(cron = "0/30 * * * * ?")
public void orderConfirmForPaypal() throws SerializeException {
// log.info("PayPal orderConfirm 被执行......");
@@ -85,7 +85,7 @@ public class PaymentTask {
}
// 提前7天向用户发送提醒邮件,每天早上8点执行
@Scheduled(cron = "0 0 8 * * ?")
// @Scheduled(cron = "0 0 8 * * ?")
public void subscriptionReminder(){
stripeService.subscriptionReminder();
}
@@ -102,13 +102,13 @@ public class PaymentTask {
}
@Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
// @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
public void updateAffiliateInfoWithPayment(){
// log.info("佣金计算定时器");
affiliateService.updateAffiliateInfoWithPayment();
}
@Scheduled(cron = "0 0 8 28-31 * ?")
// @Scheduled(cron = "0 0 8 28-31 * ?")
public void commissionSummaryReminder(){
// 每个月末的最后一天的早上八点执行
LocalDate today = LocalDate.now();

View File

@@ -93,7 +93,7 @@ public class RequestInfoUtil {
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String output;
StringBuilder outputBuilder = new StringBuilder();
System.out.println("Output from Server .... \n");
// System.out.println("Output from Server .... \n");
while ((output = br.readLine()) != null) {
outputBuilder.append(output);
System.out.println(output);

View File

@@ -4,6 +4,7 @@ import com.ai.da.mapper.primary.entity.PaymentInfo;
import com.ai.da.model.vo.OrderListVO;
import com.ai.da.model.vo.PaymentInfoVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@@ -26,4 +27,6 @@ public interface PaymentInfoMapper extends BaseMapper<PaymentInfo> {
List<Map<String, String>> getCities();
List<Map<String, String>> getCountries();
int insertIgnore(@Param("paymentInfo")PaymentInfo paymentInfo);
}

View File

@@ -2,7 +2,8 @@ package com.ai.da.mapper.primary;
import com.ai.da.mapper.primary.entity.SubscriptionInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
public interface SubscriptionInfoMapper extends BaseMapper<SubscriptionInfo> {
int insertIgnore(@Param("subscriptionInfo") SubscriptionInfo subscriptionInfo);
}

View File

@@ -41,7 +41,7 @@ public class DesignItemDetailPrint {
/**
* 印花缩放比例
*/
private Double scale;
private String scale;
/**
* 印花旋转角度
*/

View File

@@ -19,7 +19,7 @@ public class SubscriptionInfo extends BaseEntity{
// month || year
private String type;
// active || expired
// active || canceled
private String status = "active";
private byte cancelNotified = (byte)0;

View File

@@ -29,11 +29,11 @@ public class DesignSinglePrint implements Serializable {
private String minIOPath;
@ApiModelProperty("印花位置")
private List<Double> location;
private List<Float> location;
@ApiModelProperty("印花大小")
@Range(max = 1, message = "印花缩放值需用大于等于0小于等于1的数表示")
private Double scale;
private List<Float> scale;
@Range(min = -360, max = 360, message = "印花旋转角度范围为-360° ~ 360°")
@ApiModelProperty("印花角度")
@@ -46,12 +46,12 @@ public class DesignSinglePrint implements Serializable {
public DesignSinglePrint() {
}
public DesignSinglePrint(String path, Double scale) {
public DesignSinglePrint(String path, List<Float> scale) {
this.path = path;
this.scale = scale;
}
public DesignSinglePrint(String level2Type, String path, String minIOPath, List<Double> location, Double scale, Double angle, Integer priority, Boolean ifSingle) {
public DesignSinglePrint(String level2Type, String path, String minIOPath, List<Float> location, List<Float> scale, Double angle, Integer priority, Boolean ifSingle) {
this.level2Type = level2Type;
this.path = path;
this.minIOPath = minIOPath;

View File

@@ -2767,13 +2767,13 @@ public class PythonService {
int size = printObject.size();
// 占位符填充数组
List<List<Double>> locationS = new ArrayList<>(Collections.nCopies(size, null));
List<Double> scaleS = new ArrayList<>(Collections.nCopies(size, null));
List<List<Float>> locationS = new ArrayList<>(Collections.nCopies(size, null));
List<List<Float>> scaleS = new ArrayList<>(Collections.nCopies(size, null));
List<Double> angleS = new ArrayList<>(Collections.nCopies(size, null));
ArrayList<String> pathsS = new ArrayList<>(Collections.nCopies(size, null));
List<List<Double>> locationO = new ArrayList<>(Collections.nCopies(size, null));
List<Double> scaleO = new ArrayList<>(Collections.nCopies(size, null));
List<List<Float>> locationO = new ArrayList<>(Collections.nCopies(size, null));
List<List<Float>> scaleO = new ArrayList<>(Collections.nCopies(size, null));
List<Double> angleO = new ArrayList<>(Collections.nCopies(size, null));
ArrayList<String> pathsO = new ArrayList<>(Collections.nCopies(size, null));
@@ -2830,8 +2830,8 @@ public class PythonService {
int size = trims.getPrints().size();
// 占位符填充数组
List<List<Double>> location = new ArrayList<>(Collections.nCopies(size, null));
List<Double> scale = new ArrayList<>(Collections.nCopies(size, null));
List<List<Float>> location = new ArrayList<>(Collections.nCopies(size, null));
List<List<Float>> scale = new ArrayList<>(Collections.nCopies(size, null));
List<Double> angle = new ArrayList<>(Collections.nCopies(size, null));
ArrayList<String> paths = new ArrayList<>(Collections.nCopies(size, null));
@@ -2841,6 +2841,8 @@ public class PythonService {
prints.forEach(p -> {
p.getLocation().set(0, p.getLocation().get(0));
p.getLocation().set(1, p.getLocation().get(1));
p.getScale().set(0, p.getScale().get(0));
p.getScale().set(1, p.getScale().get(1));
Integer priority = p.getPriority();
location.set(priority - 1, p.getLocation());
scale.set(priority - 1, p.getScale());

View File

@@ -10,12 +10,12 @@ import java.util.List;
public class DesignPythonItemElement {
@ApiModelProperty("print的位置 传 [[0.2, 0.2]]")
private List<List<Double>> location = new ArrayList<>();
private List<List<Float>> location = new ArrayList<>();
private List<String> element_path_list = new ArrayList<>();
@ApiModelProperty("print的缩放比例 传 [0.2, 0.2]")
private List<Double> element_scale_list = new ArrayList<>();
private List<List<Float>> element_scale_list = new ArrayList<>();
@ApiModelProperty("print的旋转角度 传 [0.2, 0.2]")
private List<Double> element_angle_list = new ArrayList<>();

View File

@@ -36,10 +36,10 @@ public class DesignPythonItemPrint {
@ApiModelProperty("print的位置 传 [[0.2, 0.2]]")
private List<List<Double>> location = new ArrayList<>();
private List<List<Float>> location = new ArrayList<>();
@ApiModelProperty("print的缩放比例 传 [0.2, 0.2]")
private List<Double> print_scale_list = new ArrayList<>();
private List<List<Float>> print_scale_list = new ArrayList<>();
@ApiModelProperty("print的旋转角度 传 [0.2, 0.2]")
private List<Double> print_angle_list = new ArrayList<>();
@@ -52,8 +52,8 @@ public class DesignPythonItemPrint {
public DesignPythonItemPrint(List<String> print_path_list, Boolean ifDesign) {
if (ifDesign){
this.print_path_list = print_path_list;
this.location = Collections.singletonList(Arrays.asList(0.0, 0.0));
this.print_scale_list = Arrays.asList(0.0, 0.0);
this.location = Collections.singletonList(Arrays.asList(0.0f, 0.0f));
this.print_scale_list = Collections.singletonList(Arrays.asList(0.0f, 0.0f));
this.print_angle_list = Arrays.asList(0.0, 0.0);
}

View File

@@ -816,7 +816,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
designItemDetailPrint.setPrintType(printType);
designItemDetailPrint.setLevel2Type(print.getLevel2Type());
designItemDetailPrint.setPath(print.getMinIOPath());
designItemDetailPrint.setScale(print.getScale());
designItemDetailPrint.setScale(print.getScale().toString());
designItemDetailPrint.setSingleOrOverall(printType.equals("print") ? print.getIfSingle() ? "single" : "overall" : "single");
designItemDetailPrint.setCreateDate(LocalDateTime.now(ZoneId.of(timeZone)));
// single、overall模式下都有position、angle和priority

View File

@@ -820,7 +820,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
print.setPosition("[0.0,0.0]");
// print.setScale(1d);
// todo mark 将print默认scale置为0.3
print.setScale(0.3d);
print.setScale(Arrays.toString(new Float[]{0.3f, 0.3f}));
print.setAngle(0.0);
print.setPriority(1);
QueryWrapper<CollectionElement> getPrintboardLevel2TypeQw = new QueryWrapper<>();
@@ -951,7 +951,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
print.setPosition("[0.0,0.0]");
// print.setScale(1d);
// todo mark 将print默认scale置为0.3
print.setScale(0.3d);
print.setScale(Arrays.toString(new Float[]{0.3f, 0.3f}));
print.setAngle(0.0);
print.setPriority(1);
QueryWrapper<CollectionElement> getPrintboardLevel2TypeQw = new QueryWrapper<>();
@@ -1596,12 +1596,12 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
DesignSinglePrint designSinglePrint = new DesignSinglePrint();
// designSinglePrintDTO.setIfSingle(detailPrint.getSingleOrOverall().equals("single") ? Boolean.TRUE : Boolean.FALSE);
designSinglePrint.setLevel2Type(detailPrint.getLevel2Type());
designSinglePrint.setLocation(JSONArray.parseArray(detailPrint.getPosition(), Double.class));
designSinglePrint.setLocation(JSONArray.parseArray(detailPrint.getPosition(), Float.class));
designSinglePrint.setAngle(detailPrint.getAngle());
designSinglePrint.setPriority(detailPrint.getPriority());
designSinglePrint.setPath(minioUtil.getPreSignedUrl(detailPrint.getPath(), 24 * 60));
designSinglePrint.setMinIOPath(detailPrint.getPath());
designSinglePrint.setScale(detailPrint.getScale());
designSinglePrint.setScale(JSONArray.parseArray(detailPrint.getScale(), Float.class));
designSinglePrint.setIfSingle(detailPrint.getSingleOrOverall().equals("single") ? Boolean.TRUE : Boolean.FALSE);
prints.add(designSinglePrint);
} else {
@@ -1613,8 +1613,8 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
print.getLevel2Type(),
minioUtil.getPreSignedUrl(print.getPath(), 24 * 60),
print.getPath(),
JSONArray.parseArray(print.getPosition(), Double.class),
print.getScale(),
JSONArray.parseArray(print.getPosition(), Float.class),
JSONArray.parseArray(print.getScale(), Float.class),
print.getAngle(),
print.getPriority(),
print.getSingleOrOverall().equals("single") ? Boolean.TRUE : Boolean.FALSE));
@@ -1977,7 +1977,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
print.setPosition("[0.0,0.0]");
// print.setScale(1d);
// todo mark 将print默认scale置为0.3
print.setScale(0.3d);
print.setScale(Arrays.toString(new Float[]{0.3f, 0.3f}));
print.setAngle(0.0);
print.setPriority(1);
QueryWrapper<CollectionElement> getPrintboardLevel2TypeQw = new QueryWrapper<>();

View File

@@ -285,7 +285,8 @@ public class PaymentInfoServiceImpl extends ServiceImpl<PaymentInfoMapper, Payme
paymentInfo.setCity(orderByOrderNo.getCity());
paymentInfo.setIpAddress(orderByOrderNo.getIpAddress());
}
baseMapper.insert(paymentInfo);
int row = baseMapper.insertIgnore(paymentInfo);
log.info("Payment Info insert affect rows:{}", row);
}else {
paymentInfo.setTradeState(status);
paymentInfo.setUpdateTime(LocalDateTime.now());
@@ -354,7 +355,8 @@ public class PaymentInfoServiceImpl extends ServiceImpl<PaymentInfoMapper, Payme
paymentInfo.setCity(orderByOrderNo.getCity());
paymentInfo.setIpAddress(orderByOrderNo.getIpAddress());
}
baseMapper.insert(paymentInfo);
int row = baseMapper.insertIgnore(paymentInfo);
log.info("Payment Info insert affect rows:{}", row);
}else {
paymentInfo.setTradeState(charge.getStatus());
paymentInfo.setPaymentMethod(paymentMethod);

View File

@@ -482,7 +482,9 @@ public class StripeServiceImpl implements StripeService {
subscriptionInfo.setCurrentPeriodStart(subscription.getCurrentPeriodStart());
subscriptionInfo.setCurrentPeriodEnd(subscription.getCurrentPeriodEnd());
subscriptionInfo.setCreateTime(LocalDateTime.now());
subscriptionInfoMapper.insert(subscriptionInfo);
int rows = subscriptionInfoMapper.insertIgnore(subscriptionInfo);
log.info("Subscription info insert affect rows : {}", rows);
if (subscriptionInfo.getStatus().equals("active")){
log.info("创建订阅更新账号信息");