From 5d3692a2049a568f0a1730edb1b527796f26d33e Mon Sep 17 00:00:00 2001 From: xupei Date: Wed, 8 Apr 2026 13:52:38 +0800 Subject: [PATCH 01/25] =?UTF-8?q?BUGFIX:=E6=94=AF=E4=BB=98=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E5=90=8E=E7=9A=84=E9=82=AE=E4=BB=B6=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E9=94=99=E8=AF=AF=EF=BC=88=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/service/impl/StripeServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/service/impl/StripeServiceImpl.java b/src/main/java/com/ai/da/service/impl/StripeServiceImpl.java index ea3c758c..d297b159 100644 --- a/src/main/java/com/ai/da/service/impl/StripeServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/StripeServiceImpl.java @@ -1060,11 +1060,12 @@ public class StripeServiceImpl implements StripeService { String periodEnd = DateUtil.changeTimeStampFormat(subscriptionInfo.getCurrentPeriodEnd(), "seconds", CommonConstant.TIME_FORMAT_yyyy_MM_dd_HH_mm_ss); qwPI.lambda().eq(PaymentInfo::getOrderNo, subscriptionInfo.getOrderNo()) + .eq(PaymentInfo::getTradeState, "paid") .between(PaymentInfo::getCreateTime, periodStart, periodEnd) .orderByDesc(PaymentInfo::getId); List paymentInfos = paymentInfoMapper.selectList(qwPI); if (paymentInfos.isEmpty()) { - log.info("不发送邮件,原因:【根据order_no:{},查询到的paymentInfos为空】", orderNo); + log.info("不发送邮件,原因:【根据order_no:{},查询到的成功的paymentInfos为空】", orderNo); return false; } PaymentInfo paymentInfo = paymentInfos.get(0); From f3aeeb35844124454ad86c3584e0053fa1f6200d Mon Sep 17 00:00:00 2001 From: xupei Date: Fri, 10 Apr 2026 22:21:56 +0800 Subject: [PATCH 02/25] DEBUG --- .../controller/SavedCollectionController.java | 47 +++- .../impl/UserLikeGroupServiceImpl.java | 201 +++++++++++++++++- 2 files changed, 241 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/ai/da/controller/SavedCollectionController.java b/src/main/java/com/ai/da/controller/SavedCollectionController.java index 29a4b80f..94c247f9 100644 --- a/src/main/java/com/ai/da/controller/SavedCollectionController.java +++ b/src/main/java/com/ai/da/controller/SavedCollectionController.java @@ -253,7 +253,32 @@ public class SavedCollectionController { @Operation(summary = "relight") @PostMapping("/relight") public Response> relight(@Valid @RequestBody ToProductImageDTO toProductImageDTO) { - return Response.success(userLikeGroupService.relight(toProductImageDTO)); + log.info("【relight请求】收到relight请求, projectId={}, isDefaultLike={}, taskCount={}", + toProductImageDTO.getProjectId(), + toProductImageDTO.getIsDefaultLike(), + toProductImageDTO.getToProductImageVOList() != null ? toProductImageDTO.getToProductImageVOList().size() : 0); + long startTime = System.currentTimeMillis(); + List result = userLikeGroupService.relight(toProductImageDTO); + long costTime = System.currentTimeMillis() - startTime; + log.info("【relight请求】relight请求处理完成, projectId={}, 返回结果数={}, 耗时={}ms", + toProductImageDTO.getProjectId(), + result != null ? result.size() : 0, + costTime); + // 打印返回结果中的关键信息,用于追踪 collection_sort 变动 + if (result != null) { + for (int i = 0; i < result.size(); i++) { + ToProductImageResultVO vo = result.get(i); + log.info("【relight请求】第{}个结果: id={}, taskId={}, isLike={}, parentId={}, sort={}, status={}", + i + 1, + vo.getId(), + vo.getTaskId(), + vo.getIsLike(), + vo.getParentId(), + vo.getSort(), + vo.getStatus()); + } + } + return Response.success(result); } @Operation(summary = "转relight元素") @@ -265,7 +290,27 @@ public class SavedCollectionController { @Operation(summary = "获取relight结果") @PostMapping("/relightResult") public Response> getRelightResult(@Valid @RequestBody List taskIdList) { + log.info("【getRelightResult请求】收到获取relight结果请求, taskIdList={}", taskIdList); + long startTime = System.currentTimeMillis(); List magicToolResultVOList = userLikeGroupService.getRelightResult(taskIdList); + long costTime = System.currentTimeMillis() - startTime; + log.info("【getRelightResult请求】获取relight结果处理完成, taskIdList={}, 返回结果数={}, 耗时={}ms", + taskIdList, + magicToolResultVOList != null ? magicToolResultVOList.size() : 0, + costTime); + // 打印返回结果中的关键信息,用于追踪 collection_sort 变动 + if (magicToolResultVOList != null) { + for (int i = 0; i < magicToolResultVOList.size(); i++) { + MagicToolResultVO vo = magicToolResultVOList.get(i); + log.info("【getRelightResult请求】第{}个结果: taskId={}, status={}, id={}, parentId={}, url={}", + i + 1, + vo.getTaskId(), + vo.getStatus(), + vo.getId(), + vo.getParentId(), + vo.getUrl() != null ? (vo.getUrl().length() > 50 ? vo.getUrl().substring(0, 50) + "..." : vo.getUrl()) : null); + } + } return Response.success(magicToolResultVOList); } diff --git a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java index 47e8b587..f06fdc21 100644 --- a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java @@ -905,15 +905,15 @@ public class UserLikeGroupServiceImpl extends ServiceImpl result = new ArrayList<>(); @@ -1352,20 +1353,30 @@ public class UserLikeGroupServiceImpl extends ServiceImpl results = new ArrayList<>(); Set collect = new HashSet<>(); taskIdList.forEach(taskId -> { + log.info("【getRelightResult方法】开始处理taskId={}", taskId); QueryWrapper qw = new QueryWrapper<>(); qw.lambda().eq(ToProductImageResult::getTaskId, taskId); ToProductImageResult toProductImageResult = toProductImageResultMapper.selectOne(qw); if (Objects.isNull(toProductImageResult)) { + log.error("【getRelightResult方法】未找到toProductImageResult记录, taskId={}", taskId); throw new BusinessException("source.image.does.not.exist"); } + log.info("【getRelightResult方法】找到toProductImageResult记录, id={}, taskId={}, status={}, modelName={}, isLike={}", + toProductImageResult.getId(), taskId, toProductImageResult.getStatus(), + toProductImageResult.getModelName(), toProductImageResult.getIsLike()); + + // 查询collection_sort记录,用于追踪 + QueryWrapper sortQw = new QueryWrapper<>(); + sortQw.lambda().eq(CollectionSort::getRelationId, toProductImageResult.getId()) + .eq(CollectionSort::getRelationType, CollectionType.RELIGHT.getValue()); + List beforeSorts = collectionSortMapper.selectList(sortQw); + log.info("【getRelightResult方法】处理前collection_sort记录数={}, resultId={}", beforeSorts.size(), toProductImageResult.getId()); + if (!beforeSorts.isEmpty()) { + for (CollectionSort cs : beforeSorts) { + log.info("【getRelightResult方法】处理前collection_sort记录: id={}, relationId={}, sort={}", cs.getId(), cs.getRelationId(), cs.getSort()); + } + } + ToProductImageRecord toProductImageRecord = toProductImageRecordMapper.selectById(toProductImageResult.getToProductImageRecordId()); if (Objects.isNull(toProductImageRecord)) { + log.error("【getRelightResult方法】未找到toProductImageRecord记录, recordId={}", toProductImageResult.getToProductImageRecordId()); throw new BusinessException("This task does not exist."); } // 判断当任务从哪个模型获取结果 if (!StringUtil.isNullOrEmpty(toProductImageResult.getModelName()) && toProductImageResult.getModelName().equals("flux")) { + log.info("【getRelightResult方法】使用flux模型处理, resultId={}", toProductImageResult.getId()); Project project = projectService.getById(toProductImageResult.getProjectId()); if (Objects.isNull(project)) { + log.error("【getRelightResult方法】未找到project记录, projectId={}", toProductImageResult.getProjectId()); throw new BusinessException("unknown project"); } String fluxResult; if (toProductImageResult.getStatus().equals("Success") && !StringUtil.isNullOrEmpty(toProductImageResult.getUrl())) { + log.info("【getRelightResult方法】数据库中已有成功结果,直接使用, resultId={}", toProductImageResult.getId()); fluxResult = toProductImageResult.getUrl(); } else { String objectName = project.getAccountId() + "/relight_image/" + taskId + ".png"; + log.info("【getRelightResult方法】调用getFluxResult获取结果, resultId={}, objectName={}", toProductImageResult.getId(), objectName); fluxResult = generateService.getFluxResult(taskId, objectName); + log.info("【getRelightResult方法】getFluxResult返回结果, resultId={}, fluxResult={}", toProductImageResult.getId(), fluxResult); } if (StringUtil.isNullOrEmpty(fluxResult)) { + log.warn("【getRelightResult方法】fluxResult为null,判定为失败, resultId={}, isLike={}", toProductImageResult.getId(), toProductImageResult.getIsLike()); toProductImageResult.setStatus("Fail"); toProductImageResultMapper.updateById(toProductImageResult); - sortRank(toProductImageResult); + if (toProductImageResult.getIsLike() != null && toProductImageResult.getIsLike() == 1) { + log.info("【getRelightResult方法】isLike=1,准备调用sortRank删除collection_sort记录, resultId={}", toProductImageResult.getId()); + sortRank(toProductImageResult); + } else { + log.info("【getRelightResult方法】isLike不等于1,不删除collection_sort记录, resultId={}, isLike={}", toProductImageResult.getId(), toProductImageResult.getIsLike()); + } results.add(new MagicToolResultVO(taskId, "Fail")); } else if (fluxResult.equals("Fail") || fluxResult.equals("Pending")) { + log.warn("【getRelightResult方法】fluxResult为{},判定为失败/待处理, resultId={}, isLike={}", fluxResult, toProductImageResult.getId(), toProductImageResult.getIsLike()); toProductImageResult.setStatus(fluxResult); toProductImageResultMapper.updateById(toProductImageResult); - sortRank(toProductImageResult); + if (toProductImageResult.getIsLike() != null && toProductImageResult.getIsLike() == 1) { + log.info("【getRelightResult方法】isLike=1,准备调用sortRank删除collection_sort记录, resultId={}", toProductImageResult.getId()); + sortRank(toProductImageResult); + } else { + log.info("【getRelightResult方法】isLike不等于1,不删除collection_sort记录, resultId={}, isLike={}", toProductImageResult.getId(), toProductImageResult.getIsLike()); + } results.add(new MagicToolResultVO(taskId, fluxResult)); } else { + log.info("【getRelightResult方法】fluxResult有效,调用processFluxResult处理成功结果, resultId={}", toProductImageResult.getId()); results.add(processFluxResult(fluxResult, toProductImageResult, taskId, toProductImageRecord.getPrompt())); // 扣积分 Boolean flag = creditsService.taskCreditsDeduction(project.getAccountId(), taskId); @@ -1479,9 +1538,21 @@ public class UserLikeGroupServiceImpl extends ServiceImpl afterSorts = collectionSortMapper.selectList(sortQw); + log.info("【getRelightResult方法】处理后collection_sort记录数={}, resultId={}", afterSorts.size(), toProductImageResult.getId()); + if (!afterSorts.isEmpty()) { + for (CollectionSort cs : afterSorts) { + log.info("【getRelightResult方法】处理后collection_sort记录: id={}, relationId={}, sort={}", cs.getId(), cs.getRelationId(), cs.getSort()); + } + } else if (!beforeSorts.isEmpty()) { + log.warn("【getRelightResult方法】collection_sort记录被删除了! resultId={}, 处理前记录数={}, 处理后记录数=0", toProductImageResult.getId(), beforeSorts.size()); + } + return; } + log.info("【getRelightResult方法】非flux模型,从Redis获取结果, resultId={}", toProductImageResult.getId()); String key = relightResultKey + ":" + taskId; MagicToolResultVO magicToolResultVO = new Gson().fromJson(redisUtil.getFromString(key), MagicToolResultVO.class); if (!Objects.isNull(magicToolResultVO) && !StringUtil.isNullOrEmpty(magicToolResultVO.getUrl())) { @@ -1513,7 +1584,9 @@ public class UserLikeGroupServiceImpl extends ServiceImpl childSortList = collectionSortMapper.selectList(childCollectionQw); List childList = new ArrayList<>(); + // 收集需要删除的失败记录ID,用于后续统一清理并重新排序 + List failedSortIds = new ArrayList<>(); for (CollectionSort userLikeSort : childSortList) { if (userLikeSort.getRelationType().equals(CollectionType.TO_PRODUCT_IMAGE.getValue())) { ToProductImageResult toProductImageResult = toProductImageResultMapper.selectById(userLikeSort.getRelationId()); if (isGenerateTaskFailed(toProductImageResult.getStatus(), toProductImageResult.getCreateTime())) { + failedSortIds.add(userLikeSort.getId()); + log.info("【获取内容】TO_PRODUCT_IMAGE结果失败,relationId={},即将从collection_sort中删除", userLikeSort.getRelationId()); continue; } toProductImageResult.setUrl(getMinioUrl(toProductImageResult.getUrl())); @@ -2238,6 +2315,8 @@ public class UserLikeGroupServiceImpl extends ServiceImpl(); + for (CollectionSort userLikeSort : childSortList) { + if (userLikeSort.getRelationType().equals(CollectionType.TO_PRODUCT_IMAGE.getValue())) { + ToProductImageResult toProductImageResult = toProductImageResultMapper.selectById(userLikeSort.getRelationId()); + if (isGenerateTaskFailed(toProductImageResult.getStatus(), toProductImageResult.getCreateTime())) { + continue; + } + toProductImageResult.setUrl(getMinioUrl(toProductImageResult.getUrl())); + ToProductImageResultVO toProductImageResultVO = CopyUtil.copyObject(toProductImageResult, ToProductImageResultVO.class); + + ToProductImageRecord toProductImageRecord = toProductImageRecordMapper.selectById(toProductImageResult.getToProductImageRecordId()); + if (Objects.isNull(toProductImageRecord)) { + continue; + } + toProductImageResultVO.setPrompt(toProductImageRecord.getPrompt()); + + if (toProductImageResultVO.getElementType().equals("ProductElement")) { + ToProductElement toProductElement = toProductElementMapper.selectById(toProductImageResultVO.getElementId()); + toProductImageResultVO.setSourceUrl(getMinioUrl(toProductElement.getUrl())); + } else if ((toProductImageResultVO.getElementType().equals("DesignOutfit"))) { + TDesignPythonOutfit tDesignPythonOutfit = designPythonOutfitMapper.selectById(toProductImageResultVO.getElementId()); + toProductImageResultVO.setSourceUrl(getMinioUrl(tDesignPythonOutfit.getDesignUrl())); + } else { + ToProductImageResult toProductImageResult1 = toProductImageResultMapper.selectById(toProductImageResultVO.getElementId()); + toProductImageResultVO.setSourceUrl(getMinioUrl(toProductImageResult1.getUrl())); + } + toProductImageResultVO.setCollectionType(CollectionType.TO_PRODUCT_IMAGE.getValue()); + toProductImageResultVO.setSort(userLikeSort.getSort()); + toProductImageResultVO.setUserLikeSortId(userLikeSort.getId()); + toProductImageResultVO.setRelationType(userLikeSort.getRelationType()); + toProductImageResultVO.setParentId(userLikeSort.getParentId()); + childList.add(toProductImageResultVO); + } else if (userLikeSort.getRelationType().equals(CollectionType.RELIGHT.getValue())) { + ToProductImageResult toProductImageResult = toProductImageResultMapper.selectById(userLikeSort.getRelationId()); + if (isGenerateTaskFailed(toProductImageResult.getStatus(), toProductImageResult.getCreateTime())) { + continue; + } + toProductImageResult.setUrl(getMinioUrl(toProductImageResult.getUrl())); + ToProductImageResultVO toProductImageResultVO = CopyUtil.copyObject(toProductImageResult, ToProductImageResultVO.class); + + ToProductImageRecord toProductImageRecord = toProductImageRecordMapper.selectById(toProductImageResult.getToProductImageRecordId()); + if (Objects.isNull(toProductImageRecord)) { + continue; + } + toProductImageResultVO.setPrompt(toProductImageRecord.getPrompt()); + + if (toProductImageResultVO.getElementType().equals("ProductElement")) { + ToProductElement toProductElement = toProductElementMapper.selectById(toProductImageResultVO.getElementId()); + toProductImageResultVO.setSourceUrl(getMinioUrl(toProductElement.getUrl())); + } else if ((toProductImageResultVO.getElementType().equals("DesignOutfit"))) { + TDesignPythonOutfit tDesignPythonOutfit = designPythonOutfitMapper.selectById(toProductImageResultVO.getElementId()); + toProductImageResultVO.setSourceUrl(getMinioUrl(tDesignPythonOutfit.getDesignUrl())); + } else { + ToProductImageResult toProductImageResult1 = toProductImageResultMapper.selectById(toProductImageResultVO.getElementId()); + toProductImageResultVO.setSourceUrl(getMinioUrl(toProductImageResult1.getUrl())); + } + toProductImageResultVO.setCollectionType(CollectionType.RELIGHT.getValue()); + toProductImageResultVO.setSort(userLikeSort.getSort()); + toProductImageResultVO.setUserLikeSortId(userLikeSort.getId()); + toProductImageResultVO.setRelationType(userLikeSort.getRelationType()); + toProductImageResultVO.setParentId(userLikeSort.getParentId()); + childList.add(toProductImageResultVO); + } else if (userLikeSort.getRelationType().equals(CollectionType.POSE_TRANSFORM.getValue())) { + PoseTransformation item = poseTransformationMapper.selectById(userLikeSort.getRelationId()); + if (isGenerateTaskFailed(item.getTaskStatus(), item.getCreateTime())) { + continue; + } + PoseTransformationVO poseTransformationVO = new PoseTransformationVO(); + 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())); + poseTransformationVO.setIsLiked(item.getIsLiked()); + poseTransformationVO.setCollectionType(CollectionType.POSE_TRANSFORM.getValue()); + poseTransformationVO.setSort(userLikeSort.getSort()); + poseTransformationVO.setUserLikeSortId(userLikeSort.getId()); + poseTransformationVO.setRelationType(userLikeSort.getRelationType()); + poseTransformationVO.setResultType(CollectionType.POSE_TRANSFORM.getValue()); + poseTransformationVO.setParentId(userLikeSort.getParentId()); + poseTransformationVO.setModelName(item.getModelName()); + poseTransformationVO.setPoseId(item.getPoseId()); + poseTransformationVO.setStatus(item.getTaskStatus()); + childList.add(poseTransformationVO); + } + } + log.info("【获取内容】失败记录清理完成,重新排序后childList.size={}", childList.size()); + } o.setChildList(childList); list.add(o); From 983d53268d69f29b9a24c0ea8c82d5b279fef3f8 Mon Sep 17 00:00:00 2001 From: xupei Date: Fri, 10 Apr 2026 22:32:55 +0800 Subject: [PATCH 03/25] DEBUG --- .../java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java index f06fdc21..43a99362 100644 --- a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java @@ -1519,7 +1519,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl Date: Fri, 10 Apr 2026 22:51:00 +0800 Subject: [PATCH 04/25] BUGFIX --- .../controller/SavedCollectionController.java | 47 +----------- .../impl/UserLikeGroupServiceImpl.java | 71 +------------------ 2 files changed, 2 insertions(+), 116 deletions(-) diff --git a/src/main/java/com/ai/da/controller/SavedCollectionController.java b/src/main/java/com/ai/da/controller/SavedCollectionController.java index 94c247f9..29a4b80f 100644 --- a/src/main/java/com/ai/da/controller/SavedCollectionController.java +++ b/src/main/java/com/ai/da/controller/SavedCollectionController.java @@ -253,32 +253,7 @@ public class SavedCollectionController { @Operation(summary = "relight") @PostMapping("/relight") public Response> relight(@Valid @RequestBody ToProductImageDTO toProductImageDTO) { - log.info("【relight请求】收到relight请求, projectId={}, isDefaultLike={}, taskCount={}", - toProductImageDTO.getProjectId(), - toProductImageDTO.getIsDefaultLike(), - toProductImageDTO.getToProductImageVOList() != null ? toProductImageDTO.getToProductImageVOList().size() : 0); - long startTime = System.currentTimeMillis(); - List result = userLikeGroupService.relight(toProductImageDTO); - long costTime = System.currentTimeMillis() - startTime; - log.info("【relight请求】relight请求处理完成, projectId={}, 返回结果数={}, 耗时={}ms", - toProductImageDTO.getProjectId(), - result != null ? result.size() : 0, - costTime); - // 打印返回结果中的关键信息,用于追踪 collection_sort 变动 - if (result != null) { - for (int i = 0; i < result.size(); i++) { - ToProductImageResultVO vo = result.get(i); - log.info("【relight请求】第{}个结果: id={}, taskId={}, isLike={}, parentId={}, sort={}, status={}", - i + 1, - vo.getId(), - vo.getTaskId(), - vo.getIsLike(), - vo.getParentId(), - vo.getSort(), - vo.getStatus()); - } - } - return Response.success(result); + return Response.success(userLikeGroupService.relight(toProductImageDTO)); } @Operation(summary = "转relight元素") @@ -290,27 +265,7 @@ public class SavedCollectionController { @Operation(summary = "获取relight结果") @PostMapping("/relightResult") public Response> getRelightResult(@Valid @RequestBody List taskIdList) { - log.info("【getRelightResult请求】收到获取relight结果请求, taskIdList={}", taskIdList); - long startTime = System.currentTimeMillis(); List magicToolResultVOList = userLikeGroupService.getRelightResult(taskIdList); - long costTime = System.currentTimeMillis() - startTime; - log.info("【getRelightResult请求】获取relight结果处理完成, taskIdList={}, 返回结果数={}, 耗时={}ms", - taskIdList, - magicToolResultVOList != null ? magicToolResultVOList.size() : 0, - costTime); - // 打印返回结果中的关键信息,用于追踪 collection_sort 变动 - if (magicToolResultVOList != null) { - for (int i = 0; i < magicToolResultVOList.size(); i++) { - MagicToolResultVO vo = magicToolResultVOList.get(i); - log.info("【getRelightResult请求】第{}个结果: taskId={}, status={}, id={}, parentId={}, url={}", - i + 1, - vo.getTaskId(), - vo.getStatus(), - vo.getId(), - vo.getParentId(), - vo.getUrl() != null ? (vo.getUrl().length() > 50 ? vo.getUrl().substring(0, 50) + "..." : vo.getUrl()) : null); - } - } return Response.success(magicToolResultVOList); } diff --git a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java index 43a99362..b1472ff3 100644 --- a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java @@ -1305,7 +1305,6 @@ public class UserLikeGroupServiceImpl extends ServiceImpl result = new ArrayList<>(); @@ -1353,30 +1352,20 @@ public class UserLikeGroupServiceImpl extends ServiceImpl results = new ArrayList<>(); Set collect = new HashSet<>(); taskIdList.forEach(taskId -> { - log.info("【getRelightResult方法】开始处理taskId={}", taskId); QueryWrapper qw = new QueryWrapper<>(); qw.lambda().eq(ToProductImageResult::getTaskId, taskId); ToProductImageResult toProductImageResult = toProductImageResultMapper.selectOne(qw); if (Objects.isNull(toProductImageResult)) { - log.error("【getRelightResult方法】未找到toProductImageResult记录, taskId={}", taskId); throw new BusinessException("source.image.does.not.exist"); } - log.info("【getRelightResult方法】找到toProductImageResult记录, id={}, taskId={}, status={}, modelName={}, isLike={}", - toProductImageResult.getId(), taskId, toProductImageResult.getStatus(), - toProductImageResult.getModelName(), toProductImageResult.getIsLike()); - - // 查询collection_sort记录,用于追踪 - QueryWrapper sortQw = new QueryWrapper<>(); - sortQw.lambda().eq(CollectionSort::getRelationId, toProductImageResult.getId()) - .eq(CollectionSort::getRelationType, CollectionType.RELIGHT.getValue()); - List beforeSorts = collectionSortMapper.selectList(sortQw); - log.info("【getRelightResult方法】处理前collection_sort记录数={}, resultId={}", beforeSorts.size(), toProductImageResult.getId()); - if (!beforeSorts.isEmpty()) { - for (CollectionSort cs : beforeSorts) { - log.info("【getRelightResult方法】处理前collection_sort记录: id={}, relationId={}, sort={}", cs.getId(), cs.getRelationId(), cs.getSort()); - } - } - ToProductImageRecord toProductImageRecord = toProductImageRecordMapper.selectById(toProductImageResult.getToProductImageRecordId()); if (Objects.isNull(toProductImageRecord)) { - log.error("【getRelightResult方法】未找到toProductImageRecord记录, recordId={}", toProductImageResult.getToProductImageRecordId()); throw new BusinessException("This task does not exist."); } // 判断当任务从哪个模型获取结果 if (!StringUtil.isNullOrEmpty(toProductImageResult.getModelName()) && toProductImageResult.getModelName().equals("flux")) { - log.info("【getRelightResult方法】使用flux模型处理, resultId={}", toProductImageResult.getId()); Project project = projectService.getById(toProductImageResult.getProjectId()); if (Objects.isNull(project)) { - log.error("【getRelightResult方法】未找到project记录, projectId={}", toProductImageResult.getProjectId()); throw new BusinessException("unknown project"); } String fluxResult; if (toProductImageResult.getStatus().equals("Success") && !StringUtil.isNullOrEmpty(toProductImageResult.getUrl())) { - log.info("【getRelightResult方法】数据库中已有成功结果,直接使用, resultId={}", toProductImageResult.getId()); fluxResult = toProductImageResult.getUrl(); } else { String objectName = project.getAccountId() + "/relight_image/" + taskId + ".png"; - log.info("【getRelightResult方法】调用getFluxResult获取结果, resultId={}, objectName={}", toProductImageResult.getId(), objectName); fluxResult = generateService.getFluxResult(taskId, objectName); - log.info("【getRelightResult方法】getFluxResult返回结果, resultId={}, fluxResult={}", toProductImageResult.getId(), fluxResult); } if (StringUtil.isNullOrEmpty(fluxResult)) { - log.warn("【getRelightResult方法】fluxResult为null,判定为失败, resultId={}, isLike={}", toProductImageResult.getId(), toProductImageResult.getIsLike()); toProductImageResult.setStatus("Fail"); toProductImageResultMapper.updateById(toProductImageResult); if (toProductImageResult.getIsLike() != null && toProductImageResult.getIsLike() == 1) { - log.info("【getRelightResult方法】isLike=1,准备调用sortRank删除collection_sort记录, resultId={}", toProductImageResult.getId()); sortRank(toProductImageResult); - } else { - log.info("【getRelightResult方法】isLike不等于1,不删除collection_sort记录, resultId={}, isLike={}", toProductImageResult.getId(), toProductImageResult.getIsLike()); } results.add(new MagicToolResultVO(taskId, "Fail")); } else if (fluxResult.equals("Fail") || fluxResult.equals("Pending")) { - log.warn("【getRelightResult方法】fluxResult为{},判定为失败/待处理, resultId={}, isLike={}", fluxResult, toProductImageResult.getId(), toProductImageResult.getIsLike()); toProductImageResult.setStatus(fluxResult); toProductImageResultMapper.updateById(toProductImageResult); - if (fluxResult.equals("Fail") && toProductImageResult.getIsLike() != null && toProductImageResult.getIsLike() == 1) { - log.info("【getRelightResult方法】isLike=1,准备调用sortRank删除collection_sort记录, resultId={}", toProductImageResult.getId()); + if (toProductImageResult.getIsLike() != null && toProductImageResult.getIsLike() == 1) { sortRank(toProductImageResult); - } else { - log.info("【getRelightResult方法】isLike不等于1,不删除collection_sort记录, resultId={}, isLike={}", toProductImageResult.getId(), toProductImageResult.getIsLike()); } results.add(new MagicToolResultVO(taskId, fluxResult)); } else { - log.info("【getRelightResult方法】fluxResult有效,调用processFluxResult处理成功结果, resultId={}", toProductImageResult.getId()); results.add(processFluxResult(fluxResult, toProductImageResult, taskId, toProductImageRecord.getPrompt())); // 扣积分 Boolean flag = creditsService.taskCreditsDeduction(project.getAccountId(), taskId); @@ -1538,21 +1483,9 @@ public class UserLikeGroupServiceImpl extends ServiceImpl afterSorts = collectionSortMapper.selectList(sortQw); - log.info("【getRelightResult方法】处理后collection_sort记录数={}, resultId={}", afterSorts.size(), toProductImageResult.getId()); - if (!afterSorts.isEmpty()) { - for (CollectionSort cs : afterSorts) { - log.info("【getRelightResult方法】处理后collection_sort记录: id={}, relationId={}, sort={}", cs.getId(), cs.getRelationId(), cs.getSort()); - } - } else if (!beforeSorts.isEmpty()) { - log.warn("【getRelightResult方法】collection_sort记录被删除了! resultId={}, 处理前记录数={}, 处理后记录数=0", toProductImageResult.getId(), beforeSorts.size()); - } - return; } - log.info("【getRelightResult方法】非flux模型,从Redis获取结果, resultId={}", toProductImageResult.getId()); String key = relightResultKey + ":" + taskId; MagicToolResultVO magicToolResultVO = new Gson().fromJson(redisUtil.getFromString(key), MagicToolResultVO.class); if (!Objects.isNull(magicToolResultVO) && !StringUtil.isNullOrEmpty(magicToolResultVO.getUrl())) { @@ -1584,9 +1517,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl Date: Fri, 10 Apr 2026 22:55:44 +0800 Subject: [PATCH 05/25] BUGFIX --- .../java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java index b1472ff3..7758064d 100644 --- a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java @@ -1468,7 +1468,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl Date: Fri, 10 Apr 2026 23:03:15 +0800 Subject: [PATCH 06/25] =?UTF-8?q?BUGFIX=EF=BC=9A=E8=8E=B7=E5=8F=96relight?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E6=97=B6=E5=88=A0=E9=99=A4=E4=BA=86=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/service/impl/UserLikeGroupServiceImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java index 47e8b587..281c45d9 100644 --- a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java @@ -1461,12 +1461,16 @@ public class UserLikeGroupServiceImpl extends ServiceImpl Date: Fri, 10 Apr 2026 23:27:37 +0800 Subject: [PATCH 07/25] merge dev --- .../java/com/ai/da/common/config/MyTaskScheduler.java | 2 +- src/main/java/com/ai/da/common/task/AccountTask.java | 2 +- src/main/java/com/ai/da/common/task/PaymentTask.java | 6 +++--- .../com/ai/da/common/task/SubscriptionReminderTask.java | 4 ++-- src/main/java/com/ai/da/common/utils/SendEmailUtil.java | 4 ++-- .../java/com/ai/da/service/impl/AffiliateServiceImpl.java | 4 ++-- .../java/com/ai/da/service/impl/EmailServiceImpl.java | 4 ++-- src/main/resources/application.properties | 4 ++-- src/main/resources/payment.properties | 8 ++++---- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java index f7c10bcc..4b0d11f1 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -202,7 +202,7 @@ public class MyTaskScheduler { } } - // @Scheduled(cron = "0 0 9 * * ?") + @Scheduled(cron = "0 0 9 * * ?") public void sendTrialOrderExcelToManagements() { // 获取前一天日期 LocalDate yesterday = LocalDate.now().minusDays(1); diff --git a/src/main/java/com/ai/da/common/task/AccountTask.java b/src/main/java/com/ai/da/common/task/AccountTask.java index e0d90480..f8f05c53 100644 --- a/src/main/java/com/ai/da/common/task/AccountTask.java +++ b/src/main/java/com/ai/da/common/task/AccountTask.java @@ -34,7 +34,7 @@ public class AccountTask { accountService.refreshCreditsMonthly(); } - // @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(); diff --git a/src/main/java/com/ai/da/common/task/PaymentTask.java b/src/main/java/com/ai/da/common/task/PaymentTask.java index e63e9388..9947545b 100644 --- a/src/main/java/com/ai/da/common/task/PaymentTask.java +++ b/src/main/java/com/ai/da/common/task/PaymentTask.java @@ -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 被执行......"); @@ -97,7 +97,7 @@ 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(); @@ -109,7 +109,7 @@ public class PaymentTask { affiliateService.syncLinkViewCountToDB(); } - // @Scheduled(cron = "0 0 8 28-31 * ?") + @Scheduled(cron = "0 0 8 28-31 * ?") public void commissionSummaryReminder(){ // 每个月末的最后一天的早上八点执行 LocalDate today = LocalDate.now(); diff --git a/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java b/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java index 26478270..0dc60bc3 100644 --- a/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java +++ b/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java @@ -40,7 +40,7 @@ public class SubscriptionReminderTask { REMINDER_DAYS_CONFIG.put("year", 14); } - // @Scheduled(cron = "0 0 9 * * ?") + @Scheduled(cron = "0 0 9 * * ?") public void subscriptionReminder() { // 获取所有需要通知的订阅 List subscriptionInfos = getDueSubscriptions(); @@ -97,7 +97,7 @@ public class SubscriptionReminderTask { return subscriptionInfoMapper.selectList(qw); } - // @Scheduled(cron = "0 0 9 * * ?") + @Scheduled(cron = "0 0 9 * * ?") public void trialReminder() { // 今天的 00:00:00 和 23:59:59 LocalDateTime startOfDay = LocalDateTime.now().toLocalDate().atStartOfDay(); diff --git a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java index 2d7a9e74..dcdeb4bd 100644 --- a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java +++ b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java @@ -767,7 +767,7 @@ public class SendEmailUtil { try { String merchantEmail = "kimwong@code-create.com.hk"; String developer = "xupei3360@163.com"; - String[] receiverEmail = {/*merchantEmail,*/ developer}; + String[] receiverEmail = {merchantEmail, developer}; Credential cred = new Credential(SECRET_ID, SECRET_KEy); // 实例化一个http选项,可选的,没有特殊需求可以跳过 HttpProfile httpProfile = new HttpProfile(); @@ -968,7 +968,7 @@ public class SendEmailUtil { req.setFromEmailAddress(SEND_ADDRESS); String merchantEmail = "kimwong@code-create.com.hk"; String developerEmail = "xupei@code-create.com.hk"; - req.setDestination(new String[]{/*merchantEmail,*/ developerEmail}); + req.setDestination(new String[]{merchantEmail, developerEmail}); Template template = new Template(); req.setSubject("New Credit Purchase Order"); template.setTemplateID(CREDITS_PURCHASE_MERCHANT); diff --git a/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java b/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java index 853f7824..c80a0f5d 100644 --- a/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java @@ -82,7 +82,7 @@ public class AffiliateServiceImpl extends ServiceImpl merchantReceiver = Arrays.asList(/*merchantEmail,*/ developer); + List merchantReceiver = Arrays.asList(merchantEmail, developer); String merchantSubject = null; String merchantTemplate = null; @@ -731,7 +731,7 @@ public class EmailServiceImpl implements EmailService { jsonObject.put("quantity", quantity); jsonObject.put("totalFee", amount); - sendEmail(Arrays.asList(/*merchantEmail,*/ developerEmail), jsonObject, CREDITS_PURCHASE_MERCHANT, "New Credit Purchase Order", null, null); + sendEmail(Arrays.asList(merchantEmail, developerEmail), jsonObject, CREDITS_PURCHASE_MERCHANT, "New Credit Purchase Order", null, null); } private final static String COMMON_EXCEPTION_REMINDER = "135279_common-exception-reminder.html"; diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 974fee23..8550475d 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -2,7 +2,7 @@ #spring.profiles.active=test #����application-prod�ļ�(��������) -#spring.profiles.active=prod +spring.profiles.active=prod #����application-dev�ļ�(��������) -spring.profiles.active=dev +#spring.profiles.active=dev diff --git a/src/main/resources/payment.properties b/src/main/resources/payment.properties index 0f2800d6..f4b98130 100644 --- a/src/main/resources/payment.properties +++ b/src/main/resources/payment.properties @@ -27,9 +27,9 @@ paypal.webhook_id=1D107312EX592781K ##### Stripe # developer -stripe.private-key=sk_test_51P4ZZL02n1TEydyN8qQHjOA9imsFU7Oxs2HMHGy2urHnnQgSHnZuu5vVP6pKhEACwUpsKNyrbZpdcg5TJWJLRHcY008dEO1fn2 +#stripe.private-key=sk_test_51P4ZZL02n1TEydyN8qQHjOA9imsFU7Oxs2HMHGy2urHnnQgSHnZuu5vVP6pKhEACwUpsKNyrbZpdcg5TJWJLRHcY008dEO1fn2 # dev 端点 -stripe.webhook-sign-secret=whsec_e0dBiJngx6qqgJj6yPyJ2A9ouh1Cjv5w +#stripe.webhook-sign-secret=whsec_e0dBiJngx6qqgJj6yPyJ2A9ouh1Cjv5w # local 端点 #stripe.webhook-sign-secret=whsec_TJcMSnAkh4uktrNY1M6Iy8XaVze4Rzqm @@ -43,8 +43,8 @@ stripe.webhook-sign-secret=whsec_e0dBiJngx6qqgJj6yPyJ2A9ouh1Cjv5w #stripe.webhook-sign-secret=whsec_pX0pPMQm85PaUSWnFMEzoccb3MGNkjoL # kim - live -#stripe.private-key=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 +stripe.private-key=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 # prod 端点 -#stripe.webhook-sign-secret=whsec_hhGDgdelQRHSg4LmChtQe41crj41eb11 +stripe.webhook-sign-secret=whsec_hhGDgdelQRHSg4LmChtQe41crj41eb11 # dev 端点 #stripe.webhook-sign-secret=whsec_cFUtjUOo8wnrIKZmt4GNvt7ZY1bOfrYr From 14002e7331b6bfd9e67458b80f3f2c9abe587fce Mon Sep 17 00:00:00 2001 From: litianxiang Date: Mon, 13 Apr 2026 10:22:43 +0800 Subject: [PATCH 08/25] =?UTF-8?q?GlobalAward=E4=B8=8B=E8=BD=BD=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E5=92=8C=E6=95=B0=E9=87=8F=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../da/controller/GlobalAwardController.java | 6 +++ .../com/ai/da/service/GlobalAwardService.java | 6 +++ .../service/impl/GlobalAwardServiceImpl.java | 52 ++++++++++++++++--- 3 files changed, 56 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/ai/da/controller/GlobalAwardController.java b/src/main/java/com/ai/da/controller/GlobalAwardController.java index e36a7b77..9d1171cc 100644 --- a/src/main/java/com/ai/da/controller/GlobalAwardController.java +++ b/src/main/java/com/ai/da/controller/GlobalAwardController.java @@ -182,6 +182,12 @@ public class GlobalAwardController { return Response.success(exportedCount); } + @GetMapping("/contestants/count") + @ApiOperation(value = "查询参赛者总数", notes = "查询数据库中参赛者的总数量") + public Response getContestantCount() { + return Response.success(globalAwardService.getContestantCount()); + } + } diff --git a/src/main/java/com/ai/da/service/GlobalAwardService.java b/src/main/java/com/ai/da/service/GlobalAwardService.java index 5dcde74f..16091a9b 100644 --- a/src/main/java/com/ai/da/service/GlobalAwardService.java +++ b/src/main/java/com/ai/da/service/GlobalAwardService.java @@ -39,6 +39,12 @@ public interface GlobalAwardService { * @return 导出的参赛者数量 */ int exportContestantFiles(Integer minContestantNumber, Integer maxContestantNumber) throws Exception; + + /** + * 查询参赛者总数 + * @return 参赛者数量 + */ + long getContestantCount(); } diff --git a/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java b/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java index 210da7de..ffb84c07 100644 --- a/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java @@ -265,11 +265,9 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { r.createCell(ci++).setCellValue(cst.getPhoneNumber() == null ? "" : cst.getPhoneNumber()); r.createCell(ci++).setCellValue(cst.getDesignTitle() == null ? "" : cst.getDesignTitle()); r.createCell(ci++).setCellValue(cst.getDesignDescription() == null ? "" : cst.getDesignDescription()); -// r.createCell(ci++).setCellValue(cst.getPdfPath() == null ? "" : cst.getPdfPath()); -// r.createCell(ci++).setCellValue(cst.getVideoPath() == null ? "" : cst.getVideoPath()); - // 视频时长(秒) + r.createCell(ci++).setCellValue(cst.getPdfPath() == null ? "" : cst.getPdfPath()); + r.createCell(ci++).setCellValue(cst.getVideoPath() == null ? "" : cst.getVideoPath()); r.createCell(ci++).setCellValue(cst.getVideoDuration() == null ? "" : cst.getVideoDuration().toString()); - // 视频大小、PDF 大小:以 MB 导出,保留两位小数 if (cst.getVideoSize() == null) { r.createCell(ci++).setCellValue(""); } else { @@ -332,11 +330,9 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { r.createCell(ci++).setCellValue(cst.getPhoneNumber() == null ? "" : cst.getPhoneNumber()); r.createCell(ci++).setCellValue(cst.getDesignTitle() == null ? "" : cst.getDesignTitle()); r.createCell(ci++).setCellValue(cst.getDesignDescription() == null ? "" : cst.getDesignDescription()); -// r.createCell(ci++).setCellValue(cst.getPdfPath() == null ? "" : cst.getPdfPath()); -// r.createCell(ci++).setCellValue(cst.getVideoPath() == null ? "" : cst.getVideoPath()); - // 视频时长(秒) + r.createCell(ci++).setCellValue(cst.getPdfPath() == null ? "" : cst.getPdfPath()); + r.createCell(ci++).setCellValue(cst.getVideoPath() == null ? "" : cst.getVideoPath()); r.createCell(ci++).setCellValue(cst.getVideoDuration() == null ? "" : cst.getVideoDuration().toString()); - // 视频大小、PDF 大小:以 MB 导出,保留两位小数 if (cst.getVideoSize() == null) { r.createCell(ci++).setCellValue(""); } else { @@ -549,6 +545,37 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { } } + // 生成参赛者信息 txt 文件 + try { + StringBuilder sb = new StringBuilder(); + sb.append("=== Contestant Information ===\n\n"); + sb.append("ID: ").append(nullSafe(contestant.getId())).append("\n"); + sb.append("Email: ").append(nullSafe(contestant.getEmail())).append("\n"); + sb.append("Contestant Number: ").append(contestantNumber).append("\n"); + sb.append("First Name: ").append(nullSafe(contestant.getFirstName())).append("\n"); + sb.append("Last Name: ").append(nullSafe(contestant.getLastName())).append("\n"); + sb.append("Gender: ").append(nullSafe(contestant.getGender())).append("\n"); + sb.append("Occupation: ").append(nullSafe(contestant.getOccupation())).append("\n"); + sb.append("Age: ").append(contestant.getAge() != null ? contestant.getAge() : "N/A").append("\n"); + sb.append("Country/Region/City: ").append(nullSafe(contestant.getCountryRegionCity())).append("\n"); + sb.append("Phone Number: ").append(nullSafe(contestant.getPhoneNumber())).append("\n"); + sb.append("Design Title: ").append(nullSafe(contestant.getDesignTitle())).append("\n"); + sb.append("Design Description: ").append(nullSafe(contestant.getDesignDescription())).append("\n"); + sb.append("PDF Path: ").append(nullSafe(contestant.getPdfPath())).append("\n"); + sb.append("PDF Size (bytes): ").append(contestant.getPdfSize() != null ? contestant.getPdfSize() : "N/A").append("\n"); + sb.append("Video Path: ").append(nullSafe(contestant.getVideoPath())).append("\n"); + sb.append("Video Duration (seconds): ").append(contestant.getVideoDuration() != null ? contestant.getVideoDuration() : "N/A").append("\n"); + sb.append("Video Size (bytes): ").append(contestant.getVideoSize() != null ? contestant.getVideoSize() : "N/A").append("\n"); + sb.append("Created At: ").append(contestant.getCreatedAt() != null ? contestant.getCreatedAt() : "N/A").append("\n"); + sb.append("Updated At: ").append(contestant.getUpdatedAt() != null ? contestant.getUpdatedAt() : "N/A").append("\n"); + + String infoFilePath = contestantPath.resolve("contestant_info.txt").toString(); + Files.write(Paths.get(infoFilePath), sb.toString().getBytes(java.nio.charset.StandardCharsets.UTF_8)); + log.info("Generated info file for contestant {}", contestantNumber); + } catch (Exception e) { + log.error("Failed to generate info file for contestant {}: {}", contestantNumber, e.getMessage()); + } + exportedCount++; } @@ -583,6 +610,15 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { // 下载文件 minioUtil.downloadMinioObjectToLocal(bucketName, objectName, localFilePath.toString()); } + + @Override + public long getContestantCount() { + return contestantMapper.selectCount(null); + } + + private String nullSafe(String value) { + return value != null ? value : "N/A"; + } } From 029b96ae99219e8ddad922f016f3e3d998fafacc Mon Sep 17 00:00:00 2001 From: litianxiang Date: Mon, 13 Apr 2026 11:47:20 +0800 Subject: [PATCH 09/25] =?UTF-8?q?GlobalAward=E4=B8=8B=E8=BD=BD=E5=88=B0?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../da/controller/GlobalAwardController.java | 17 ++- .../com/ai/da/service/GlobalAwardService.java | 6 +- .../service/impl/GlobalAwardServiceImpl.java | 138 ++++++++---------- 3 files changed, 75 insertions(+), 86 deletions(-) diff --git a/src/main/java/com/ai/da/controller/GlobalAwardController.java b/src/main/java/com/ai/da/controller/GlobalAwardController.java index 9d1171cc..fb5f0001 100644 --- a/src/main/java/com/ai/da/controller/GlobalAwardController.java +++ b/src/main/java/com/ai/da/controller/GlobalAwardController.java @@ -176,10 +176,19 @@ public class GlobalAwardController { } @PostMapping("/contestants/export/files") - @ApiOperation(value = "导出参赛者文件到本地", notes = "根据参赛者编号范围导出PDF和视频文件到本地temp/uploads/contestants目录") - public Response exportContestantFiles(@ApiParam(value = "参赛者文件导出请求", required = true) @RequestBody ContestantExportRequest request) throws Exception { - int exportedCount = globalAwardService.exportContestantFiles(request.getMinContestantNumber(), request.getMaxContestantNumber()); - return Response.success(exportedCount); + @ApiOperation(value = "导出参赛者文件为ZIP", notes = "根据参赛者编号范围导出PDF、视频和信息文件为ZIP,直接响应给浏览器") + public void exportContestantFiles(@ApiParam(value = "参赛者文件导出请求", required = true) @RequestBody ContestantExportRequest request, HttpServletResponse response) throws Exception { + byte[] zipData = globalAwardService.exportContestantFilesAsZip(request.getMinContestantNumber(), request.getMaxContestantNumber()); + if (zipData.length == 0) { + response.setStatus(HttpServletResponse.SC_NOT_FOUND); + response.getWriter().write("No contestants found in the specified range."); + return; + } + response.setContentType("application/zip"); + response.setHeader("Content-Disposition", "attachment; filename=\"contestants.zip\""); + response.setContentLength(zipData.length); + response.getOutputStream().write(zipData); + response.getOutputStream().flush(); } @GetMapping("/contestants/count") diff --git a/src/main/java/com/ai/da/service/GlobalAwardService.java b/src/main/java/com/ai/da/service/GlobalAwardService.java index 16091a9b..a6643276 100644 --- a/src/main/java/com/ai/da/service/GlobalAwardService.java +++ b/src/main/java/com/ai/da/service/GlobalAwardService.java @@ -33,12 +33,12 @@ public interface GlobalAwardService { void saveContestantsToLocal() throws Exception; /** - * 根据参赛者编号范围导出参赛者文件到本地目录 + * 将参赛者文件打包为 ZIP 并返回字节数组(不落盘,直接响应给浏览器) * @param minContestantNumber 最小参赛者编号 * @param maxContestantNumber 最大参赛者编号 - * @return 导出的参赛者数量 + * @return ZIP 文件的字节数组 */ - int exportContestantFiles(Integer minContestantNumber, Integer maxContestantNumber) throws Exception; + byte[] exportContestantFilesAsZip(Integer minContestantNumber, Integer maxContestantNumber) throws Exception; /** * 查询参赛者总数 diff --git a/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java b/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java index ffb84c07..17395a0e 100644 --- a/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java @@ -26,24 +26,22 @@ import org.springframework.transaction.annotation.Transactional; import jakarta.annotation.Resource; +import java.io.ByteArrayOutputStream; +import java.io.FileOutputStream; import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.*; -import java.io.ByteArrayOutputStream; -import java.io.IOException; - -import jakarta.servlet.http.HttpServletResponse; +import java.util.zip.ZipEntry; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.io.FileOutputStream; -import java.time.format.DateTimeFormatter; @Service @Slf4j @@ -476,7 +474,7 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { } @Override - public int exportContestantFiles(Integer minContestantNumber, Integer maxContestantNumber) throws Exception { + public byte[] exportContestantFilesAsZip(Integer minContestantNumber, Integer maxContestantNumber) throws Exception { if (minContestantNumber == null || maxContestantNumber == null) { throw new BusinessException("minContestantNumber and maxContestantNumber are required."); } @@ -484,7 +482,7 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { throw new BusinessException("minContestantNumber cannot be greater than maxContestantNumber."); } - // 1. 根据contestantNumber范围查询参赛者 + // 1. 根据 contestantNumber 范围查询参赛者 QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.lambda() .ge(Contestant::getContestantNumber, minContestantNumber) @@ -494,59 +492,37 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { if (contestants.isEmpty()) { log.info("No contestants found in range [{}, {}]", minContestantNumber, maxContestantNumber); - return 0; + return new byte[0]; } - // 2. 创建基础目录 - String baseDir = uploadDir + "/contestants"; - Path basePath = Paths.get(baseDir).toAbsolutePath(); - Files.createDirectories(basePath); - log.info("Base directory created: {}", basePath); + // 2. 在内存中构建 ZIP + try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); + java.util.zip.ZipOutputStream zos = new java.util.zip.ZipOutputStream(baos)) { - int exportedCount = 0; - - // 3. 遍历每个参赛者,下载文件 - for (Contestant contestant : contestants) { - Integer contestantNumber = contestant.getContestantNumber(); - if (contestantNumber == null) { - log.warn("Contestant {} has no contestantNumber, skipping", contestant.getId()); - continue; - } - - // 创建参赛者文件夹 - String contestantDir = baseDir + "/" + contestantNumber; - Path contestantPath = Paths.get(contestantDir); - Files.createDirectories(contestantPath); - - // 下载PDF文件 - String pdfPath = contestant.getPdfPath(); - if (StringUtils.isNotBlank(pdfPath)) { - try { - String fileName = pdfPath.contains("/") ? - pdfPath.substring(pdfPath.lastIndexOf("/") + 1) : "design.pdf"; - downloadFileFromMinio(pdfPath, contestantPath.toString(), "design.pdf"); - log.info("Downloaded PDF for contestant {}", fileName); - } catch (Exception e) { - log.error("Failed to download PDF for contestant {}: {}", contestantNumber, e.getMessage()); + for (Contestant contestant : contestants) { + Integer contestantNumber = contestant.getContestantNumber(); + if (contestantNumber == null) { + log.warn("Contestant {} has no contestantNumber, skipping", contestant.getId()); + continue; } - } - // 下载视频文件 - String videoPath = contestant.getVideoPath(); - if (StringUtils.isNotBlank(videoPath)) { - try { - // 根据路径判断视频格式 + String dirPrefix = contestantNumber + "/"; + + // 添加 PDF 文件 + String pdfPath = contestant.getPdfPath(); + if (StringUtils.isNotBlank(pdfPath)) { + addMinioFileToZip(zos, pdfPath, dirPrefix + "design.pdf"); + } + + // 添加视频文件 + String videoPath = contestant.getVideoPath(); + if (StringUtils.isNotBlank(videoPath)) { String fileName = videoPath.contains("/") ? videoPath.substring(videoPath.lastIndexOf("/") + 1) : "video.mp4"; - downloadFileFromMinio(videoPath, contestantPath.toString(), fileName); - log.info("Downloaded video for contestant {}", contestantNumber); - } catch (Exception e) { - log.error("Failed to download video for contestant {}: {}", contestantNumber, e.getMessage()); + addMinioFileToZip(zos, videoPath, dirPrefix + fileName); } - } - // 生成参赛者信息 txt 文件 - try { + // 添加参赛者信息 txt 文件 StringBuilder sb = new StringBuilder(); sb.append("=== Contestant Information ===\n\n"); sb.append("ID: ").append(nullSafe(contestant.getId())).append("\n"); @@ -561,54 +537,58 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { sb.append("Phone Number: ").append(nullSafe(contestant.getPhoneNumber())).append("\n"); sb.append("Design Title: ").append(nullSafe(contestant.getDesignTitle())).append("\n"); sb.append("Design Description: ").append(nullSafe(contestant.getDesignDescription())).append("\n"); - sb.append("PDF Path: ").append(nullSafe(contestant.getPdfPath())).append("\n"); + sb.append("PDF Path: ").append(nullSafe(pdfPath)).append("\n"); sb.append("PDF Size (bytes): ").append(contestant.getPdfSize() != null ? contestant.getPdfSize() : "N/A").append("\n"); - sb.append("Video Path: ").append(nullSafe(contestant.getVideoPath())).append("\n"); + sb.append("Video Path: ").append(nullSafe(videoPath)).append("\n"); sb.append("Video Duration (seconds): ").append(contestant.getVideoDuration() != null ? contestant.getVideoDuration() : "N/A").append("\n"); sb.append("Video Size (bytes): ").append(contestant.getVideoSize() != null ? contestant.getVideoSize() : "N/A").append("\n"); sb.append("Created At: ").append(contestant.getCreatedAt() != null ? contestant.getCreatedAt() : "N/A").append("\n"); sb.append("Updated At: ").append(contestant.getUpdatedAt() != null ? contestant.getUpdatedAt() : "N/A").append("\n"); - String infoFilePath = contestantPath.resolve("contestant_info.txt").toString(); - Files.write(Paths.get(infoFilePath), sb.toString().getBytes(java.nio.charset.StandardCharsets.UTF_8)); - log.info("Generated info file for contestant {}", contestantNumber); - } catch (Exception e) { - log.error("Failed to generate info file for contestant {}: {}", contestantNumber, e.getMessage()); + ZipEntry infoEntry = new ZipEntry(dirPrefix + "contestant_info.txt"); + zos.putNextEntry(infoEntry); + zos.write(sb.toString().getBytes(java.nio.charset.StandardCharsets.UTF_8)); + zos.closeEntry(); + log.info("Added contestant {} info to zip", contestantNumber); } - exportedCount++; + zos.finish(); + log.info("ZIP built for {} contestants, size: {} bytes", contestants.size(), baos.size()); + return baos.toByteArray(); } - - log.info("Exported {} contestants' files to {}", exportedCount, basePath); - return exportedCount; } /** - * 从MinIO下载文件到本地 - * @param minioPath MinIO路径 (格式: bucketName/objectPath) - * @param localDir 本地目录 - * @param fileName 本地文件名 + * 将 MinIO 文件流式写入 ZIP,不落盘 + * @param zos ZIP 输出流 + * @param minioPath MinIO 路径(格式: bucketName/objectPath) + * @param entryName ZIP 条目名称 */ - private void downloadFileFromMinio(String minioPath, String localDir, String fileName) { + private void addMinioFileToZip(java.util.zip.ZipOutputStream zos, String minioPath, String entryName) { if (StringUtils.isBlank(minioPath)) { return; } - - // 从路径中提取bucket名称和对象名称 int index = minioPath.indexOf("/"); if (index == -1) { log.warn("Invalid MinIO path: {}", minioPath); return; } - String bucketName = minioPath.substring(0, index); String objectName = minioPath.substring(index + 1); - // 构建本地文件完整路径 - Path localFilePath = Paths.get(localDir, fileName); - - // 下载文件 - minioUtil.downloadMinioObjectToLocal(bucketName, objectName, localFilePath.toString()); + try (InputStream in = minioUtil.download(bucketName, objectName)) { + ZipEntry entry = new ZipEntry(entryName); + zos.putNextEntry(entry); + byte[] buffer = new byte[8192]; + int bytesRead; + while ((bytesRead = in.read(buffer)) != -1) { + zos.write(buffer, 0, bytesRead); + } + zos.closeEntry(); + log.info("Added {} to zip ({} bytes)", entryName, entry.getSize()); + } catch (Exception e) { + log.error("Failed to add {} to zip: {}", entryName, e.getMessage()); + } } @Override From ec6a5df8afebc8334c538ac030da9d57d08e92ad Mon Sep 17 00:00:00 2001 From: litianxiang Date: Mon, 13 Apr 2026 11:55:17 +0800 Subject: [PATCH 10/25] TO DEV --- .../java/com/ai/da/common/config/MyTaskScheduler.java | 2 +- src/main/java/com/ai/da/common/task/AccountTask.java | 2 +- src/main/java/com/ai/da/common/task/PaymentTask.java | 6 +++--- .../com/ai/da/common/task/SubscriptionReminderTask.java | 4 ++-- src/main/java/com/ai/da/common/utils/SendEmailUtil.java | 4 ++-- .../java/com/ai/da/service/impl/AffiliateServiceImpl.java | 4 ++-- .../java/com/ai/da/service/impl/EmailServiceImpl.java | 4 ++-- src/main/resources/application.properties | 4 ++-- src/main/resources/payment.properties | 8 ++++---- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java index 4b0d11f1..f7c10bcc 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -202,7 +202,7 @@ public class MyTaskScheduler { } } - @Scheduled(cron = "0 0 9 * * ?") + // @Scheduled(cron = "0 0 9 * * ?") public void sendTrialOrderExcelToManagements() { // 获取前一天日期 LocalDate yesterday = LocalDate.now().minusDays(1); diff --git a/src/main/java/com/ai/da/common/task/AccountTask.java b/src/main/java/com/ai/da/common/task/AccountTask.java index f8f05c53..e0d90480 100644 --- a/src/main/java/com/ai/da/common/task/AccountTask.java +++ b/src/main/java/com/ai/da/common/task/AccountTask.java @@ -34,7 +34,7 @@ public class AccountTask { accountService.refreshCreditsMonthly(); } - @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(); diff --git a/src/main/java/com/ai/da/common/task/PaymentTask.java b/src/main/java/com/ai/da/common/task/PaymentTask.java index 9947545b..e63e9388 100644 --- a/src/main/java/com/ai/da/common/task/PaymentTask.java +++ b/src/main/java/com/ai/da/common/task/PaymentTask.java @@ -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 被执行......"); @@ -97,7 +97,7 @@ 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(); @@ -109,7 +109,7 @@ public class PaymentTask { affiliateService.syncLinkViewCountToDB(); } - @Scheduled(cron = "0 0 8 28-31 * ?") + // @Scheduled(cron = "0 0 8 28-31 * ?") public void commissionSummaryReminder(){ // 每个月末的最后一天的早上八点执行 LocalDate today = LocalDate.now(); diff --git a/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java b/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java index 0dc60bc3..26478270 100644 --- a/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java +++ b/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java @@ -40,7 +40,7 @@ public class SubscriptionReminderTask { REMINDER_DAYS_CONFIG.put("year", 14); } - @Scheduled(cron = "0 0 9 * * ?") + // @Scheduled(cron = "0 0 9 * * ?") public void subscriptionReminder() { // 获取所有需要通知的订阅 List subscriptionInfos = getDueSubscriptions(); @@ -97,7 +97,7 @@ public class SubscriptionReminderTask { return subscriptionInfoMapper.selectList(qw); } - @Scheduled(cron = "0 0 9 * * ?") + // @Scheduled(cron = "0 0 9 * * ?") public void trialReminder() { // 今天的 00:00:00 和 23:59:59 LocalDateTime startOfDay = LocalDateTime.now().toLocalDate().atStartOfDay(); diff --git a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java index dcdeb4bd..2d7a9e74 100644 --- a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java +++ b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java @@ -767,7 +767,7 @@ public class SendEmailUtil { try { String merchantEmail = "kimwong@code-create.com.hk"; String developer = "xupei3360@163.com"; - String[] receiverEmail = {merchantEmail, developer}; + String[] receiverEmail = {/*merchantEmail,*/ developer}; Credential cred = new Credential(SECRET_ID, SECRET_KEy); // 实例化一个http选项,可选的,没有特殊需求可以跳过 HttpProfile httpProfile = new HttpProfile(); @@ -968,7 +968,7 @@ public class SendEmailUtil { req.setFromEmailAddress(SEND_ADDRESS); String merchantEmail = "kimwong@code-create.com.hk"; String developerEmail = "xupei@code-create.com.hk"; - req.setDestination(new String[]{merchantEmail, developerEmail}); + req.setDestination(new String[]{/*merchantEmail,*/ developerEmail}); Template template = new Template(); req.setSubject("New Credit Purchase Order"); template.setTemplateID(CREDITS_PURCHASE_MERCHANT); diff --git a/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java b/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java index c80a0f5d..853f7824 100644 --- a/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java @@ -82,7 +82,7 @@ public class AffiliateServiceImpl extends ServiceImpl merchantReceiver = Arrays.asList(merchantEmail, developer); + List merchantReceiver = Arrays.asList(/*merchantEmail,*/ developer); String merchantSubject = null; String merchantTemplate = null; @@ -731,7 +731,7 @@ public class EmailServiceImpl implements EmailService { jsonObject.put("quantity", quantity); jsonObject.put("totalFee", amount); - sendEmail(Arrays.asList(merchantEmail, developerEmail), jsonObject, CREDITS_PURCHASE_MERCHANT, "New Credit Purchase Order", null, null); + sendEmail(Arrays.asList(/*merchantEmail,*/ developerEmail), jsonObject, CREDITS_PURCHASE_MERCHANT, "New Credit Purchase Order", null, null); } private final static String COMMON_EXCEPTION_REMINDER = "135279_common-exception-reminder.html"; diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 8550475d..974fee23 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -2,7 +2,7 @@ #spring.profiles.active=test #����application-prod�ļ�(��������) -spring.profiles.active=prod +#spring.profiles.active=prod #����application-dev�ļ�(��������) -#spring.profiles.active=dev +spring.profiles.active=dev diff --git a/src/main/resources/payment.properties b/src/main/resources/payment.properties index f4b98130..0f2800d6 100644 --- a/src/main/resources/payment.properties +++ b/src/main/resources/payment.properties @@ -27,9 +27,9 @@ paypal.webhook_id=1D107312EX592781K ##### Stripe # developer -#stripe.private-key=sk_test_51P4ZZL02n1TEydyN8qQHjOA9imsFU7Oxs2HMHGy2urHnnQgSHnZuu5vVP6pKhEACwUpsKNyrbZpdcg5TJWJLRHcY008dEO1fn2 +stripe.private-key=sk_test_51P4ZZL02n1TEydyN8qQHjOA9imsFU7Oxs2HMHGy2urHnnQgSHnZuu5vVP6pKhEACwUpsKNyrbZpdcg5TJWJLRHcY008dEO1fn2 # dev 端点 -#stripe.webhook-sign-secret=whsec_e0dBiJngx6qqgJj6yPyJ2A9ouh1Cjv5w +stripe.webhook-sign-secret=whsec_e0dBiJngx6qqgJj6yPyJ2A9ouh1Cjv5w # local 端点 #stripe.webhook-sign-secret=whsec_TJcMSnAkh4uktrNY1M6Iy8XaVze4Rzqm @@ -43,8 +43,8 @@ paypal.webhook_id=1D107312EX592781K #stripe.webhook-sign-secret=whsec_pX0pPMQm85PaUSWnFMEzoccb3MGNkjoL # kim - live -stripe.private-key=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 +#stripe.private-key=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 # prod 端点 -stripe.webhook-sign-secret=whsec_hhGDgdelQRHSg4LmChtQe41crj41eb11 +#stripe.webhook-sign-secret=whsec_hhGDgdelQRHSg4LmChtQe41crj41eb11 # dev 端点 #stripe.webhook-sign-secret=whsec_cFUtjUOo8wnrIKZmt4GNvt7ZY1bOfrYr From 409bc7b1fd19719b3cfae05b2e24698c0a9fa0ef Mon Sep 17 00:00:00 2001 From: litianxiang Date: Mon, 13 Apr 2026 13:09:12 +0800 Subject: [PATCH 11/25] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=99=A8=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/common/security/filter/AuthenticationFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java b/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java index ec24bfad..444f27a7 100644 --- a/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java +++ b/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java @@ -64,7 +64,7 @@ public class AuthenticationFilter extends OncePerRequestFilter { "/api/global-award/uploads/pdf/init", "/api/global-award/uploads/pdf/chunk", "/api/global-award/uploads/pdf/complete", "/api/global-award/uploads/pdf/status", "/api/global-award/uploads/video/init", "/api/global-award/uploads/video/chunk", "/api/global-award/uploads/video/complete", "/api/global-award/uploads/video/status", "/api/global-award/contestants/save", "/api/global-award/contestants/by-email", "/api/global-award/checkEmail", "/api/global-award/checkCode","/api/global-award/contestants/export", - "/api/global-award/contestants/export/files" + "/api/global-award/contestants/export/files", "/api/global-award/contestants/count" ); @Override From 6b5bacc49b3bd4979054ad03e47aebac238b711b Mon Sep 17 00:00:00 2001 From: litianxiang Date: Mon, 13 Apr 2026 14:34:05 +0800 Subject: [PATCH 12/25] =?UTF-8?q?GlobalAward=E8=BF=94=E5=9B=9E=E6=9C=80?= =?UTF-8?q?=E5=A4=A7=E7=9A=84=E5=8F=82=E8=B5=9B=E8=80=85=E7=BC=96=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../da/controller/GlobalAwardController.java | 5 +++-- .../com/ai/da/service/GlobalAwardService.java | 7 ++++--- .../service/impl/GlobalAwardServiceImpl.java | 18 ++++++++++++++++-- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/ai/da/controller/GlobalAwardController.java b/src/main/java/com/ai/da/controller/GlobalAwardController.java index fb5f0001..a63d566b 100644 --- a/src/main/java/com/ai/da/controller/GlobalAwardController.java +++ b/src/main/java/com/ai/da/controller/GlobalAwardController.java @@ -4,6 +4,7 @@ import com.ai.da.common.response.Response; import com.ai.da.model.dto.*; import com.ai.da.model.dto.ContestantDTO; import com.ai.da.model.vo.CheckOTPVO; +import com.ai.da.model.vo.ContestantCountVO; import com.ai.da.service.GlobalAwardService; import com.ai.da.service.upload.UploadService; import com.ai.da.service.upload.UploadTask; @@ -192,8 +193,8 @@ public class GlobalAwardController { } @GetMapping("/contestants/count") - @ApiOperation(value = "查询参赛者总数", notes = "查询数据库中参赛者的总数量") - public Response getContestantCount() { + @ApiOperation(value = "查询参赛者总数", notes = "查询数据库中参赛者的总数量和最大参赛者编号") + public Response getContestantCount() { return Response.success(globalAwardService.getContestantCount()); } diff --git a/src/main/java/com/ai/da/service/GlobalAwardService.java b/src/main/java/com/ai/da/service/GlobalAwardService.java index a6643276..76232238 100644 --- a/src/main/java/com/ai/da/service/GlobalAwardService.java +++ b/src/main/java/com/ai/da/service/GlobalAwardService.java @@ -2,6 +2,7 @@ package com.ai.da.service; import com.ai.da.model.dto.ContestantDTO; import com.ai.da.model.vo.CheckOTPVO; +import com.ai.da.model.vo.ContestantCountVO; import org.springframework.web.multipart.MultipartFile; import java.util.Map; @@ -41,10 +42,10 @@ public interface GlobalAwardService { byte[] exportContestantFilesAsZip(Integer minContestantNumber, Integer maxContestantNumber) throws Exception; /** - * 查询参赛者总数 - * @return 参赛者数量 + * 查询参赛者总数和最大参赛者编号 + * @return 参赛者数量和最大参赛者编号 */ - long getContestantCount(); + ContestantCountVO getContestantCount(); } diff --git a/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java b/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java index 17395a0e..e4bc7d01 100644 --- a/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java @@ -12,6 +12,7 @@ import com.ai.da.mapper.primary.entity.Notification; import com.ai.da.model.dto.ContestantDTO; import com.ai.da.model.dto.PublishSysNotificationDTO; import com.ai.da.model.vo.CheckOTPVO; +import com.ai.da.model.vo.ContestantCountVO; import com.ai.da.service.GlobalAwardService; import com.ai.da.service.MessageCenterService; import com.alibaba.fastjson.JSON; @@ -592,8 +593,21 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { } @Override - public long getContestantCount() { - return contestantMapper.selectCount(null); + public ContestantCountVO getContestantCount() { + long count = contestantMapper.selectCount(null); + Integer maxContestantNumber = null; + QueryWrapper qMax = new QueryWrapper<>(); + qMax.isNotNull("contestant_number"); + qMax.orderByDesc("contestant_number"); + qMax.last("LIMIT 1"); + Contestant last = contestantMapper.selectOne(qMax); + if (last != null) { + maxContestantNumber = last.getContestantNumber(); + } + return ContestantCountVO.builder() + .count(count) + .maxContestantNumber(maxContestantNumber) + .build(); } private String nullSafe(String value) { From 716d7207827054f2d87fcafe375c2fa13481fbb1 Mon Sep 17 00:00:00 2001 From: litianxiang Date: Mon, 13 Apr 2026 14:38:02 +0800 Subject: [PATCH 13/25] =?UTF-8?q?GlobalAward=E8=BF=94=E5=9B=9E=E6=9C=80?= =?UTF-8?q?=E5=A4=A7=E7=9A=84=E5=8F=82=E8=B5=9B=E8=80=85=E7=BC=96=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/model/vo/ContestantCountVO.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/main/java/com/ai/da/model/vo/ContestantCountVO.java diff --git a/src/main/java/com/ai/da/model/vo/ContestantCountVO.java b/src/main/java/com/ai/da/model/vo/ContestantCountVO.java new file mode 100644 index 00000000..4495049f --- /dev/null +++ b/src/main/java/com/ai/da/model/vo/ContestantCountVO.java @@ -0,0 +1,17 @@ +package com.ai.da.model.vo; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ContestantCountVO { + + private Long count; + + private Integer maxContestantNumber; +} From 107e4e9771bf8485f4ef3e0996b36365898c1963 Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 13 Apr 2026 17:51:15 +0800 Subject: [PATCH 14/25] =?UTF-8?q?BUGFIX:design=20=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E4=BD=BF=E7=94=A8printboard=E4=B8=AD=E7=9A=84=E5=85=83?= =?UTF-8?q?=E7=B4=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/service/impl/CollectionElementServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java index 87a246e5..1f34afc7 100644 --- a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java @@ -524,7 +524,7 @@ public class CollectionElementServiceImpl extends ServiceImpl Date: Mon, 13 Apr 2026 18:04:30 +0800 Subject: [PATCH 15/25] =?UTF-8?q?BUGFIX:design=20=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E4=BD=BF=E7=94=A8printboard=E4=B8=AD=E7=9A=84=E5=85=83?= =?UTF-8?q?=E7=B4=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/service/impl/CollectionElementServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java index 87a246e5..1f34afc7 100644 --- a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java @@ -524,7 +524,7 @@ public class CollectionElementServiceImpl extends ServiceImpl Date: Mon, 13 Apr 2026 22:05:31 +0800 Subject: [PATCH 16/25] TO PROD --- .../java/com/ai/da/common/config/MyTaskScheduler.java | 2 +- src/main/java/com/ai/da/common/task/AccountTask.java | 2 +- src/main/java/com/ai/da/common/task/PaymentTask.java | 6 +++--- .../com/ai/da/common/task/SubscriptionReminderTask.java | 4 ++-- src/main/java/com/ai/da/common/utils/SendEmailUtil.java | 4 ++-- .../java/com/ai/da/service/impl/AffiliateServiceImpl.java | 4 ++-- .../java/com/ai/da/service/impl/EmailServiceImpl.java | 4 ++-- src/main/resources/application.properties | 4 ++-- src/main/resources/payment.properties | 8 ++++---- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java index f7c10bcc..4b0d11f1 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -202,7 +202,7 @@ public class MyTaskScheduler { } } - // @Scheduled(cron = "0 0 9 * * ?") + @Scheduled(cron = "0 0 9 * * ?") public void sendTrialOrderExcelToManagements() { // 获取前一天日期 LocalDate yesterday = LocalDate.now().minusDays(1); diff --git a/src/main/java/com/ai/da/common/task/AccountTask.java b/src/main/java/com/ai/da/common/task/AccountTask.java index e0d90480..f8f05c53 100644 --- a/src/main/java/com/ai/da/common/task/AccountTask.java +++ b/src/main/java/com/ai/da/common/task/AccountTask.java @@ -34,7 +34,7 @@ public class AccountTask { accountService.refreshCreditsMonthly(); } - // @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(); diff --git a/src/main/java/com/ai/da/common/task/PaymentTask.java b/src/main/java/com/ai/da/common/task/PaymentTask.java index e63e9388..9947545b 100644 --- a/src/main/java/com/ai/da/common/task/PaymentTask.java +++ b/src/main/java/com/ai/da/common/task/PaymentTask.java @@ -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 被执行......"); @@ -97,7 +97,7 @@ 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(); @@ -109,7 +109,7 @@ public class PaymentTask { affiliateService.syncLinkViewCountToDB(); } - // @Scheduled(cron = "0 0 8 28-31 * ?") + @Scheduled(cron = "0 0 8 28-31 * ?") public void commissionSummaryReminder(){ // 每个月末的最后一天的早上八点执行 LocalDate today = LocalDate.now(); diff --git a/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java b/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java index 26478270..0dc60bc3 100644 --- a/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java +++ b/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java @@ -40,7 +40,7 @@ public class SubscriptionReminderTask { REMINDER_DAYS_CONFIG.put("year", 14); } - // @Scheduled(cron = "0 0 9 * * ?") + @Scheduled(cron = "0 0 9 * * ?") public void subscriptionReminder() { // 获取所有需要通知的订阅 List subscriptionInfos = getDueSubscriptions(); @@ -97,7 +97,7 @@ public class SubscriptionReminderTask { return subscriptionInfoMapper.selectList(qw); } - // @Scheduled(cron = "0 0 9 * * ?") + @Scheduled(cron = "0 0 9 * * ?") public void trialReminder() { // 今天的 00:00:00 和 23:59:59 LocalDateTime startOfDay = LocalDateTime.now().toLocalDate().atStartOfDay(); diff --git a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java index 2d7a9e74..dcdeb4bd 100644 --- a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java +++ b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java @@ -767,7 +767,7 @@ public class SendEmailUtil { try { String merchantEmail = "kimwong@code-create.com.hk"; String developer = "xupei3360@163.com"; - String[] receiverEmail = {/*merchantEmail,*/ developer}; + String[] receiverEmail = {merchantEmail, developer}; Credential cred = new Credential(SECRET_ID, SECRET_KEy); // 实例化一个http选项,可选的,没有特殊需求可以跳过 HttpProfile httpProfile = new HttpProfile(); @@ -968,7 +968,7 @@ public class SendEmailUtil { req.setFromEmailAddress(SEND_ADDRESS); String merchantEmail = "kimwong@code-create.com.hk"; String developerEmail = "xupei@code-create.com.hk"; - req.setDestination(new String[]{/*merchantEmail,*/ developerEmail}); + req.setDestination(new String[]{merchantEmail, developerEmail}); Template template = new Template(); req.setSubject("New Credit Purchase Order"); template.setTemplateID(CREDITS_PURCHASE_MERCHANT); diff --git a/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java b/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java index 853f7824..c80a0f5d 100644 --- a/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java @@ -82,7 +82,7 @@ public class AffiliateServiceImpl extends ServiceImpl merchantReceiver = Arrays.asList(/*merchantEmail,*/ developer); + List merchantReceiver = Arrays.asList(merchantEmail, developer); String merchantSubject = null; String merchantTemplate = null; @@ -731,7 +731,7 @@ public class EmailServiceImpl implements EmailService { jsonObject.put("quantity", quantity); jsonObject.put("totalFee", amount); - sendEmail(Arrays.asList(/*merchantEmail,*/ developerEmail), jsonObject, CREDITS_PURCHASE_MERCHANT, "New Credit Purchase Order", null, null); + sendEmail(Arrays.asList(merchantEmail, developerEmail), jsonObject, CREDITS_PURCHASE_MERCHANT, "New Credit Purchase Order", null, null); } private final static String COMMON_EXCEPTION_REMINDER = "135279_common-exception-reminder.html"; diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 974fee23..8550475d 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -2,7 +2,7 @@ #spring.profiles.active=test #����application-prod�ļ�(��������) -#spring.profiles.active=prod +spring.profiles.active=prod #����application-dev�ļ�(��������) -spring.profiles.active=dev +#spring.profiles.active=dev diff --git a/src/main/resources/payment.properties b/src/main/resources/payment.properties index 0f2800d6..f4b98130 100644 --- a/src/main/resources/payment.properties +++ b/src/main/resources/payment.properties @@ -27,9 +27,9 @@ paypal.webhook_id=1D107312EX592781K ##### Stripe # developer -stripe.private-key=sk_test_51P4ZZL02n1TEydyN8qQHjOA9imsFU7Oxs2HMHGy2urHnnQgSHnZuu5vVP6pKhEACwUpsKNyrbZpdcg5TJWJLRHcY008dEO1fn2 +#stripe.private-key=sk_test_51P4ZZL02n1TEydyN8qQHjOA9imsFU7Oxs2HMHGy2urHnnQgSHnZuu5vVP6pKhEACwUpsKNyrbZpdcg5TJWJLRHcY008dEO1fn2 # dev 端点 -stripe.webhook-sign-secret=whsec_e0dBiJngx6qqgJj6yPyJ2A9ouh1Cjv5w +#stripe.webhook-sign-secret=whsec_e0dBiJngx6qqgJj6yPyJ2A9ouh1Cjv5w # local 端点 #stripe.webhook-sign-secret=whsec_TJcMSnAkh4uktrNY1M6Iy8XaVze4Rzqm @@ -43,8 +43,8 @@ stripe.webhook-sign-secret=whsec_e0dBiJngx6qqgJj6yPyJ2A9ouh1Cjv5w #stripe.webhook-sign-secret=whsec_pX0pPMQm85PaUSWnFMEzoccb3MGNkjoL # kim - live -#stripe.private-key=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 +stripe.private-key=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 # prod 端点 -#stripe.webhook-sign-secret=whsec_hhGDgdelQRHSg4LmChtQe41crj41eb11 +stripe.webhook-sign-secret=whsec_hhGDgdelQRHSg4LmChtQe41crj41eb11 # dev 端点 #stripe.webhook-sign-secret=whsec_cFUtjUOo8wnrIKZmt4GNvt7ZY1bOfrYr From 40f2735831394775cf2cc8a42dc0b141c99ebe3f Mon Sep 17 00:00:00 2001 From: litianxiang Date: Wed, 15 Apr 2026 13:26:15 +0800 Subject: [PATCH 17/25] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/common/security/filter/AuthenticationFilter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java b/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java index 444f27a7..61750a07 100644 --- a/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java +++ b/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java @@ -64,7 +64,8 @@ public class AuthenticationFilter extends OncePerRequestFilter { "/api/global-award/uploads/pdf/init", "/api/global-award/uploads/pdf/chunk", "/api/global-award/uploads/pdf/complete", "/api/global-award/uploads/pdf/status", "/api/global-award/uploads/video/init", "/api/global-award/uploads/video/chunk", "/api/global-award/uploads/video/complete", "/api/global-award/uploads/video/status", "/api/global-award/contestants/save", "/api/global-award/contestants/by-email", "/api/global-award/checkEmail", "/api/global-award/checkCode","/api/global-award/contestants/export", - "/api/global-award/contestants/export/files", "/api/global-award/contestants/count" + "/api/global-award/contestants/export/files", "/api/global-award/contestants/count", + "/api/global-award/contestants/{id}" ); @Override From d33cb9f0bf95d279ec673f38d7ff437589286c8f Mon Sep 17 00:00:00 2001 From: litianxiang Date: Wed, 15 Apr 2026 13:47:28 +0800 Subject: [PATCH 18/25] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/common/security/filter/AuthenticationFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java b/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java index 61750a07..798008c7 100644 --- a/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java +++ b/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java @@ -65,7 +65,7 @@ public class AuthenticationFilter extends OncePerRequestFilter { "/api/global-award/uploads/video/init", "/api/global-award/uploads/video/chunk", "/api/global-award/uploads/video/complete", "/api/global-award/uploads/video/status", "/api/global-award/contestants/save", "/api/global-award/contestants/by-email", "/api/global-award/checkEmail", "/api/global-award/checkCode","/api/global-award/contestants/export", "/api/global-award/contestants/export/files", "/api/global-award/contestants/count", - "/api/global-award/contestants/{id}" + "/api/global-award/contestants/*" ); @Override From b0343be5449db335e214d6f9869de37c4dabdf53 Mon Sep 17 00:00:00 2001 From: litianxiang Date: Wed, 15 Apr 2026 14:05:57 +0800 Subject: [PATCH 19/25] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ai/da/common/security/filter/AuthenticationFilter.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java b/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java index 798008c7..14027e39 100644 --- a/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java +++ b/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java @@ -61,11 +61,7 @@ public class AuthenticationFilter extends OncePerRequestFilter { , "/api/account/schoolLogin", "/api/account/enterpriseLogin", "/api/account/organizationNameSearch", "/api/llm/stream", //GlobalAwardController - "/api/global-award/uploads/pdf/init", "/api/global-award/uploads/pdf/chunk", "/api/global-award/uploads/pdf/complete", "/api/global-award/uploads/pdf/status", - "/api/global-award/uploads/video/init", "/api/global-award/uploads/video/chunk", "/api/global-award/uploads/video/complete", "/api/global-award/uploads/video/status", - "/api/global-award/contestants/save", "/api/global-award/contestants/by-email", "/api/global-award/checkEmail", "/api/global-award/checkCode","/api/global-award/contestants/export", - "/api/global-award/contestants/export/files", "/api/global-award/contestants/count", - "/api/global-award/contestants/*" + "/api/global-award" ); @Override From 4df3f9cc5385d746e5681bd922ab9ce8c6480dfc Mon Sep 17 00:00:00 2001 From: xupei Date: Wed, 15 Apr 2026 14:43:59 +0800 Subject: [PATCH 20/25] =?UTF-8?q?BUGFIX:design=E5=8D=B0=E8=8A=B1scale?= =?UTF-8?q?=E4=B8=8EgetDetail=E8=8E=B7=E5=8F=96=E5=88=B0=E7=9A=84=E5=8D=B0?= =?UTF-8?q?=E8=8A=B1scale=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/service/impl/DesignServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java b/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java index b18d3b4f..3109a912 100644 --- a/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java @@ -756,7 +756,7 @@ public class DesignServiceImpl extends ServiceImpl impleme print.setPosition("[0.0,0.0]"); // print.setScale(1d); // todo mark 将print默认scale置为0.3 - print.setScale(Arrays.toString(new Float[]{0.3f, 0.3f})); + print.setScale(Arrays.toString(new Float[]{1.0f, 1.0f})); print.setAngle(0.0); print.setPriority(1); QueryWrapper getPrintboardLevel2TypeQw = new QueryWrapper<>(); From c00d906083ed37f13b1c7b628d96cdb0a41d8361 Mon Sep 17 00:00:00 2001 From: litianxiang Date: Wed, 15 Apr 2026 14:52:18 +0800 Subject: [PATCH 21/25] =?UTF-8?q?portfolioUrl=20=E6=BC=8F=E5=8A=A0fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/mapper/primary/entity/Contestant.java | 3 +++ .../com/ai/da/service/impl/GlobalAwardServiceImpl.java | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ai/da/mapper/primary/entity/Contestant.java b/src/main/java/com/ai/da/mapper/primary/entity/Contestant.java index 0e7241bb..6592df21 100644 --- a/src/main/java/com/ai/da/mapper/primary/entity/Contestant.java +++ b/src/main/java/com/ai/da/mapper/primary/entity/Contestant.java @@ -68,6 +68,9 @@ public class Contestant { @TableField("pdf_size") private Long pdfSize; + @TableField("portfolio_url") + private String portfolioUrl; + @TableField("created_at") private LocalDateTime createdAt; diff --git a/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java b/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java index e4bc7d01..804c10cd 100644 --- a/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java @@ -186,6 +186,7 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { .videoSize(request.getVideoSize()) .pdfSize(request.getPdfSize()) .contestantNumber(nextNumber) + .portfolioUrl(request.getPortfolioUrl()) .createdAt(now) .updatedAt(now) .build(); @@ -226,6 +227,7 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { existing.setVideoDuration(request.getVideoDuration()); existing.setVideoSize(request.getVideoSize()); existing.setPdfSize(request.getPdfSize()); + existing.setPortfolioUrl(request.getPortfolioUrl()); existing.setUpdatedAt(now); contestantMapper.updateById(existing); resp.put("success", true); @@ -243,7 +245,7 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { String[] headers = new String[] { "contestantNumber", "email", "firstName", "lastName", "gender", "occupation", "age", "countryRegionCity", "phoneNumber", "designTitle", "designDescription", - "pdfPath", "videoPath", "videoDuration", "videoSizeMB", "pdfSizeMB", "createdAt", "updatedAt" + "pdfPath", "videoPath", "videoDuration", "videoSizeMB", "pdfSizeMB", "portfolioUrl", "createdAt", "updatedAt" }; for (int i = 0; i < headers.length; i++) { Cell c = header.createCell(i); @@ -279,6 +281,7 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { double pMb = cst.getPdfSize() / 1024.0 / 1024.0; r.createCell(ci++).setCellValue(String.format("%.2f", pMb)); } + r.createCell(ci++).setCellValue(cst.getPortfolioUrl() == null ? "" : cst.getPortfolioUrl()); r.createCell(ci++).setCellValue(cst.getCreatedAt() == null ? "" : cst.getCreatedAt().toString()); r.createCell(ci++).setCellValue(cst.getUpdatedAt() == null ? "" : cst.getUpdatedAt().toString()); } @@ -308,7 +311,7 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { String[] headers = new String[] { "contestantNumber", "email", "firstName", "lastName", "gender", "occupation", "age", "countryRegionCity", "phoneNumber", "designTitle", "designDescription", - "pdfPath", "videoPath", "videoDuration", "videoSizeMB", "pdfSizeMB", "createdAt", "updatedAt" + "pdfPath", "videoPath", "videoDuration", "videoSizeMB", "pdfSizeMB", "portfolioUrl", "createdAt", "updatedAt" }; for (int i = 0; i < headers.length; i++) { Cell c = header.createCell(i); @@ -344,6 +347,7 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { double pMb = cst.getPdfSize() / 1024.0 / 1024.0; r.createCell(ci++).setCellValue(String.format("%.2f", pMb)); } + r.createCell(ci++).setCellValue(cst.getPortfolioUrl() == null ? "" : cst.getPortfolioUrl()); r.createCell(ci++).setCellValue(cst.getCreatedAt() == null ? "" : cst.getCreatedAt().toString()); r.createCell(ci++).setCellValue(cst.getUpdatedAt() == null ? "" : cst.getUpdatedAt().toString()); } @@ -382,6 +386,7 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { dto.setVideoDuration(existing.getVideoDuration()); dto.setPdfSize(existing.getPdfSize()); dto.setVideoSize(existing.getVideoSize()); + dto.setPortfolioUrl(existing.getPortfolioUrl()); return dto; } @@ -543,6 +548,7 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { sb.append("Video Path: ").append(nullSafe(videoPath)).append("\n"); sb.append("Video Duration (seconds): ").append(contestant.getVideoDuration() != null ? contestant.getVideoDuration() : "N/A").append("\n"); sb.append("Video Size (bytes): ").append(contestant.getVideoSize() != null ? contestant.getVideoSize() : "N/A").append("\n"); + sb.append("Portfolio URL: ").append(nullSafe(contestant.getPortfolioUrl())).append("\n"); sb.append("Created At: ").append(contestant.getCreatedAt() != null ? contestant.getCreatedAt() : "N/A").append("\n"); sb.append("Updated At: ").append(contestant.getUpdatedAt() != null ? contestant.getUpdatedAt() : "N/A").append("\n"); From f6d28fec075936b9269d25212d4b0b1c3c4c9f47 Mon Sep 17 00:00:00 2001 From: xupei Date: Tue, 21 Apr 2026 17:21:41 +0800 Subject: [PATCH 22/25] =?UTF-8?q?BUGFIX:=E4=B8=BA=E4=B8=8B=E8=BD=BDflux?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=B7=BB=E5=8A=A0=E9=87=8D=E8=AF=95=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../da/service/impl/GenerateServiceImpl.java | 47 +++++++++++++++++-- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java index d23c7b6b..bbf5111d 100644 --- a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java @@ -3934,11 +3934,48 @@ public class GenerateServiceImpl extends ServiceImpl i } public byte[] downloadVideoOrImage(String url) { - try (CloseableHttpClient client = HttpClients.createDefault(); - InputStream in = client.execute(new HttpGet(url)).getEntity().getContent()) { - return IOUtils.toByteArray(in); - } catch (IOException e) { - throw new RuntimeException(e); + int maxRetries = 3; + int retryDelayMs = 1000; + IOException lastException = null; + + for (int attempt = 1; attempt <= maxRetries; attempt++) { + try { + return downloadWithTimeout(url, 30000, 60000); + } catch (IOException e) { + lastException = e; + log.warn("下载失败 (尝试 {}/{}): {}", attempt, maxRetries, e.getMessage()); + + if (attempt < maxRetries) { + try { + Thread.sleep((long) retryDelayMs * attempt); // 递增延迟 + } catch (InterruptedException ie) { + Thread.currentThread().interrupt(); + throw new RuntimeException(ie); + } + } + } + } + + throw new RuntimeException("下载失败,已重试 " + maxRetries + " 次", lastException); + } + + private byte[] downloadWithTimeout(String url, int connectTimeout, int socketTimeout) throws IOException { + RequestConfig requestConfig = RequestConfig.custom() + .setConnectTimeout(connectTimeout) + .setSocketTimeout(socketTimeout) + .setConnectionRequestTimeout(connectTimeout) + .build(); + + try (CloseableHttpClient client = HttpClients.custom() + .setDefaultRequestConfig(requestConfig) + .build(); + CloseableHttpResponse response = client.execute(new HttpGet(url))) { + + int statusCode = response.getStatusLine().getStatusCode(); + if (statusCode != 200) { + throw new IOException("HTTP Error: " + statusCode); + } + return IOUtils.toByteArray(response.getEntity().getContent()); } } From b66877425e84dbb153f67b5b3bf066b20f6706e8 Mon Sep 17 00:00:00 2001 From: xupei Date: Tue, 21 Apr 2026 17:33:39 +0800 Subject: [PATCH 23/25] =?UTF-8?q?BUGFIX:=E4=B8=BA=E4=B8=8B=E8=BD=BDflux?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=B7=BB=E5=8A=A0=E9=87=8D=E8=AF=95=E6=9C=BA?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../da/service/impl/GenerateServiceImpl.java | 47 +++++++++++++++++-- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java index d23c7b6b..bbf5111d 100644 --- a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java @@ -3934,11 +3934,48 @@ public class GenerateServiceImpl extends ServiceImpl i } public byte[] downloadVideoOrImage(String url) { - try (CloseableHttpClient client = HttpClients.createDefault(); - InputStream in = client.execute(new HttpGet(url)).getEntity().getContent()) { - return IOUtils.toByteArray(in); - } catch (IOException e) { - throw new RuntimeException(e); + int maxRetries = 3; + int retryDelayMs = 1000; + IOException lastException = null; + + for (int attempt = 1; attempt <= maxRetries; attempt++) { + try { + return downloadWithTimeout(url, 30000, 60000); + } catch (IOException e) { + lastException = e; + log.warn("下载失败 (尝试 {}/{}): {}", attempt, maxRetries, e.getMessage()); + + if (attempt < maxRetries) { + try { + Thread.sleep((long) retryDelayMs * attempt); // 递增延迟 + } catch (InterruptedException ie) { + Thread.currentThread().interrupt(); + throw new RuntimeException(ie); + } + } + } + } + + throw new RuntimeException("下载失败,已重试 " + maxRetries + " 次", lastException); + } + + private byte[] downloadWithTimeout(String url, int connectTimeout, int socketTimeout) throws IOException { + RequestConfig requestConfig = RequestConfig.custom() + .setConnectTimeout(connectTimeout) + .setSocketTimeout(socketTimeout) + .setConnectionRequestTimeout(connectTimeout) + .build(); + + try (CloseableHttpClient client = HttpClients.custom() + .setDefaultRequestConfig(requestConfig) + .build(); + CloseableHttpResponse response = client.execute(new HttpGet(url))) { + + int statusCode = response.getStatusLine().getStatusCode(); + if (statusCode != 200) { + throw new IOException("HTTP Error: " + statusCode); + } + return IOUtils.toByteArray(response.getEntity().getContent()); } } From 65cde0b8f5b40483360b5754fa7fe2494f4030cb Mon Sep 17 00:00:00 2001 From: xupei Date: Tue, 28 Apr 2026 13:11:57 +0800 Subject: [PATCH 24/25] =?UTF-8?q?TASK:admin-organization=20plan=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ai/da/model/vo/QueryUserConditionsVO.java | 4 ++++ .../ai/da/service/impl/ConvenientInquiryServiceImpl.java | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/main/java/com/ai/da/model/vo/QueryUserConditionsVO.java b/src/main/java/com/ai/da/model/vo/QueryUserConditionsVO.java index 852ca839..2f0b0b13 100644 --- a/src/main/java/com/ai/da/model/vo/QueryUserConditionsVO.java +++ b/src/main/java/com/ai/da/model/vo/QueryUserConditionsVO.java @@ -34,4 +34,8 @@ public class QueryUserConditionsVO extends PageQueryBaseVo { private Integer systemUser; + private Long subscriptionPlanId; + + private Long organizationId; + } diff --git a/src/main/java/com/ai/da/service/impl/ConvenientInquiryServiceImpl.java b/src/main/java/com/ai/da/service/impl/ConvenientInquiryServiceImpl.java index 62b6d62b..69860284 100644 --- a/src/main/java/com/ai/da/service/impl/ConvenientInquiryServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/ConvenientInquiryServiceImpl.java @@ -787,6 +787,14 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl Date: Tue, 28 Apr 2026 13:19:10 +0800 Subject: [PATCH 25/25] TO DEV --- .../ai/da/common/config/MyTaskScheduler.java | 2 +- .../com/ai/da/common/task/AccountTask.java | 2 +- .../com/ai/da/common/task/PaymentTask.java | 4 +-- .../common/task/SubscriptionReminderTask.java | 4 +-- .../com/ai/da/common/utils/SendEmailUtil.java | 4 +-- .../da/service/impl/AffiliateServiceImpl.java | 4 +-- .../ai/da/service/impl/EmailServiceImpl.java | 4 +-- src/main/resources/application.properties | 4 +-- src/main/resources/payment.properties | 28 +++++++++---------- 9 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java index 4b0d11f1..806082cf 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -202,7 +202,7 @@ public class MyTaskScheduler { } } - @Scheduled(cron = "0 0 9 * * ?") +// @Scheduled(cron = "0 0 9 * * ?") public void sendTrialOrderExcelToManagements() { // 获取前一天日期 LocalDate yesterday = LocalDate.now().minusDays(1); diff --git a/src/main/java/com/ai/da/common/task/AccountTask.java b/src/main/java/com/ai/da/common/task/AccountTask.java index f8f05c53..2fff300b 100644 --- a/src/main/java/com/ai/da/common/task/AccountTask.java +++ b/src/main/java/com/ai/da/common/task/AccountTask.java @@ -34,7 +34,7 @@ public class AccountTask { accountService.refreshCreditsMonthly(); } - @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(); diff --git a/src/main/java/com/ai/da/common/task/PaymentTask.java b/src/main/java/com/ai/da/common/task/PaymentTask.java index 9947545b..f1e47dd7 100644 --- a/src/main/java/com/ai/da/common/task/PaymentTask.java +++ b/src/main/java/com/ai/da/common/task/PaymentTask.java @@ -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 被执行......"); @@ -109,7 +109,7 @@ public class PaymentTask { affiliateService.syncLinkViewCountToDB(); } - @Scheduled(cron = "0 0 8 28-31 * ?") +// @Scheduled(cron = "0 0 8 28-31 * ?") public void commissionSummaryReminder(){ // 每个月末的最后一天的早上八点执行 LocalDate today = LocalDate.now(); diff --git a/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java b/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java index 0dc60bc3..8195d7e7 100644 --- a/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java +++ b/src/main/java/com/ai/da/common/task/SubscriptionReminderTask.java @@ -40,7 +40,7 @@ public class SubscriptionReminderTask { REMINDER_DAYS_CONFIG.put("year", 14); } - @Scheduled(cron = "0 0 9 * * ?") +// @Scheduled(cron = "0 0 9 * * ?") public void subscriptionReminder() { // 获取所有需要通知的订阅 List subscriptionInfos = getDueSubscriptions(); @@ -97,7 +97,7 @@ public class SubscriptionReminderTask { return subscriptionInfoMapper.selectList(qw); } - @Scheduled(cron = "0 0 9 * * ?") +// @Scheduled(cron = "0 0 9 * * ?") public void trialReminder() { // 今天的 00:00:00 和 23:59:59 LocalDateTime startOfDay = LocalDateTime.now().toLocalDate().atStartOfDay(); diff --git a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java index dcdeb4bd..2d7a9e74 100644 --- a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java +++ b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java @@ -767,7 +767,7 @@ public class SendEmailUtil { try { String merchantEmail = "kimwong@code-create.com.hk"; String developer = "xupei3360@163.com"; - String[] receiverEmail = {merchantEmail, developer}; + String[] receiverEmail = {/*merchantEmail,*/ developer}; Credential cred = new Credential(SECRET_ID, SECRET_KEy); // 实例化一个http选项,可选的,没有特殊需求可以跳过 HttpProfile httpProfile = new HttpProfile(); @@ -968,7 +968,7 @@ public class SendEmailUtil { req.setFromEmailAddress(SEND_ADDRESS); String merchantEmail = "kimwong@code-create.com.hk"; String developerEmail = "xupei@code-create.com.hk"; - req.setDestination(new String[]{merchantEmail, developerEmail}); + req.setDestination(new String[]{/*merchantEmail,*/ developerEmail}); Template template = new Template(); req.setSubject("New Credit Purchase Order"); template.setTemplateID(CREDITS_PURCHASE_MERCHANT); diff --git a/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java b/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java index c80a0f5d..853f7824 100644 --- a/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java @@ -82,7 +82,7 @@ public class AffiliateServiceImpl extends ServiceImpl merchantReceiver = Arrays.asList(merchantEmail, developer); + List merchantReceiver = Arrays.asList(/*merchantEmail,*/ developer); String merchantSubject = null; String merchantTemplate = null; @@ -731,7 +731,7 @@ public class EmailServiceImpl implements EmailService { jsonObject.put("quantity", quantity); jsonObject.put("totalFee", amount); - sendEmail(Arrays.asList(merchantEmail, developerEmail), jsonObject, CREDITS_PURCHASE_MERCHANT, "New Credit Purchase Order", null, null); + sendEmail(Arrays.asList(/*merchantEmail,*/ developerEmail), jsonObject, CREDITS_PURCHASE_MERCHANT, "New Credit Purchase Order", null, null); } private final static String COMMON_EXCEPTION_REMINDER = "135279_common-exception-reminder.html"; diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 8550475d..974fee23 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -2,7 +2,7 @@ #spring.profiles.active=test #����application-prod�ļ�(��������) -spring.profiles.active=prod +#spring.profiles.active=prod #����application-dev�ļ�(��������) -#spring.profiles.active=dev +spring.profiles.active=dev diff --git a/src/main/resources/payment.properties b/src/main/resources/payment.properties index f4b98130..efda4ceb 100644 --- a/src/main/resources/payment.properties +++ b/src/main/resources/payment.properties @@ -11,25 +11,25 @@ #paypal.webhook_id=51V87014T6406322F # aida-sandbox-kim -#paypal.client-id=AbDDH8jnTrKqjnWLFgEu6LogYzVz2ZLuirE4W54t1M4lrofrP5OzXfhbxqktLLFB-rAO9KeYQVYFJ_tO -#paypal.client-secret=EOOoiIAe_dyR2YhY7qCIqWipZvYXCDrmBlFYchphuvkPFms1spsBGTlStlrx580y4hN-EukWwF9m_LAs -#paypal.receiver.email=sb-4xe8i29784722@business.example.com -#paypal.mode=sandbox -#paypal.webhook_id=1WH327112B602422N +paypal.client-id=AbDDH8jnTrKqjnWLFgEu6LogYzVz2ZLuirE4W54t1M4lrofrP5OzXfhbxqktLLFB-rAO9KeYQVYFJ_tO +paypal.client-secret=EOOoiIAe_dyR2YhY7qCIqWipZvYXCDrmBlFYchphuvkPFms1spsBGTlStlrx580y4hN-EukWwF9m_LAs +paypal.receiver.email=sb-4xe8i29784722@business.example.com +paypal.mode=sandbox +paypal.webhook_id=1WH327112B602422N # aida-live-kim -paypal.client-id=ASWSIZ3MXJU5w5VOeOHeigWcSw6iinl30ZCipruziKpHclxP0ryf8-7VKG1Ba2VwZwa2DMvGEzTfCTgz -paypal.client-secret=EHQg_K5PSqmp4FJlzEcOEH_kFkmq4aBzaI7jridw53L6cOQRULBAnfv2KakRfrsqaU1PDSkO4Co9Vyxc -paypal.receiver.email=kimwong@code-create.com.hk -paypal.mode=live -paypal.webhook_id=1D107312EX592781K +#paypal.client-id=ASWSIZ3MXJU5w5VOeOHeigWcSw6iinl30ZCipruziKpHclxP0ryf8-7VKG1Ba2VwZwa2DMvGEzTfCTgz +#paypal.client-secret=EHQg_K5PSqmp4FJlzEcOEH_kFkmq4aBzaI7jridw53L6cOQRULBAnfv2KakRfrsqaU1PDSkO4Co9Vyxc +#paypal.receiver.email=kimwong@code-create.com.hk +#paypal.mode=live +#paypal.webhook_id=1D107312EX592781K ##### Stripe # developer -#stripe.private-key=sk_test_51P4ZZL02n1TEydyN8qQHjOA9imsFU7Oxs2HMHGy2urHnnQgSHnZuu5vVP6pKhEACwUpsKNyrbZpdcg5TJWJLRHcY008dEO1fn2 +stripe.private-key=sk_test_51P4ZZL02n1TEydyN8qQHjOA9imsFU7Oxs2HMHGy2urHnnQgSHnZuu5vVP6pKhEACwUpsKNyrbZpdcg5TJWJLRHcY008dEO1fn2 # dev 端点 -#stripe.webhook-sign-secret=whsec_e0dBiJngx6qqgJj6yPyJ2A9ouh1Cjv5w +stripe.webhook-sign-secret=whsec_e0dBiJngx6qqgJj6yPyJ2A9ouh1Cjv5w # local 端点 #stripe.webhook-sign-secret=whsec_TJcMSnAkh4uktrNY1M6Iy8XaVze4Rzqm @@ -43,8 +43,8 @@ paypal.webhook_id=1D107312EX592781K #stripe.webhook-sign-secret=whsec_pX0pPMQm85PaUSWnFMEzoccb3MGNkjoL # kim - live -stripe.private-key=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 +#stripe.private-key=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 # prod 端点 -stripe.webhook-sign-secret=whsec_hhGDgdelQRHSg4LmChtQe41crj41eb11 +#stripe.webhook-sign-secret=whsec_hhGDgdelQRHSg4LmChtQe41crj41eb11 # dev 端点 #stripe.webhook-sign-secret=whsec_cFUtjUOo8wnrIKZmt4GNvt7ZY1bOfrYr