From ba2d10afbc32bb89eb55d1da0a33105becd617de Mon Sep 17 00:00:00 2001 From: xupei Date: Wed, 28 Jan 2026 15:41:52 +0800 Subject: [PATCH 01/15] =?UTF-8?q?paymentMethodConfiguration=E5=88=87?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-dev.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 3214b137..da4dfdcb 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -125,9 +125,9 @@ orderList.link=https://develop.aida.com.hk/home/homePage?order= # 0 不发送邮件通知 1 发送邮件通知 stripe.webhook.fail.reminder=0 # kim test -stripe.paymentMethodConfiguration=pmc_1LywTWH7nPZ8bkrN6FvdCUWG +#stripe.paymentMethodConfiguration=pmc_1LywTWH7nPZ8bkrN6FvdCUWG # developer test -#stripe.paymentMethodConfiguration=pmc_1QIKyq02n1TEydyNKVEYvhW7 +stripe.paymentMethodConfiguration=pmc_1QIKyq02n1TEydyNKVEYvhW7 #thymelea模板配置 #控制 Thymeleaf 是否启用模板缓存 生产环境用true,以提高性能 spring.thymeleaf.cache=false From e30fdf74012f970ff34dafbca569180c351f8f64 Mon Sep 17 00:00:00 2001 From: xupei Date: Thu, 29 Jan 2026 10:10:21 +0800 Subject: [PATCH 02/15] =?UTF-8?q?BUGFIX:=E6=A8=A1=E7=89=B9=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=EF=BC=8C=E4=BA=8B=E5=8A=A1=E7=AE=A1=E7=90=86=E4=B8=8D?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=AF=BC=E8=87=B4library=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E5=AD=A4=E5=84=BF=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/LibraryModelPointServiceImpl.java | 81 ++++++++++++------- 1 file changed, 50 insertions(+), 31 deletions(-) diff --git a/src/main/java/com/ai/da/service/impl/LibraryModelPointServiceImpl.java b/src/main/java/com/ai/da/service/impl/LibraryModelPointServiceImpl.java index 2966be9e..863d1cfe 100644 --- a/src/main/java/com/ai/da/service/impl/LibraryModelPointServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/LibraryModelPointServiceImpl.java @@ -28,6 +28,7 @@ import io.netty.util.internal.StringUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; @@ -53,7 +54,11 @@ public class LibraryModelPointServiceImpl extends ServiceImpl imagesWidthAndHeight = minioUtil.getImagesWidthAndHeight(url); libModel.setWidth(imagesWidthAndHeight.get(0)); libModel.setHigh(imagesWidthAndHeight.get(1)); @@ -104,25 +110,10 @@ public class LibraryModelPointServiceImpl extends ServiceImpl imagesWidthAndHeight = minioUtil.getImagesWidthAndHeight(url); - saveAsModel.setWidth(imagesWidthAndHeight.get(0)); - saveAsModel.setHigh(imagesWidthAndHeight.get(1)); - saveAsModel.setCreateDate(DateUtil.getByTimeZone(libraryModelPointDTO.getTimeZone())); - libraryService.save(saveAsModel); - // 更新新的模特在library中的id,用于后面新建模特点位信息用 - libraryModelPointDTO.setLibraryId(saveAsModel.getId()); + Library saveAsModel = createNewLibraryCopy(libModel, libraryModelPointDTO); // 新增模特点位信息 + libraryModelPointDTO.setLibraryId(saveAsModel.getId()); // 更新libraryId为新创建的模型ID LibraryModelPoint libraryModelPoint = resolvePoint(libraryModelPointDTO); libraryModelPoint.setModelType("Library"); libraryModelPoint.setCreateDate(DateUtil.getByTimeZone(libraryModelPointDTO.getTimeZone())); @@ -130,22 +121,50 @@ public class LibraryModelPointServiceImpl extends ServiceImpl imagesWidthAndHeight = minioUtil.getImagesWidthAndHeight(libraryModelPointDTO.getModelPath()); + saveAsModel.setWidth(imagesWidthAndHeight.get(0)); + saveAsModel.setHigh(imagesWidthAndHeight.get(1)); + saveAsModel.setCreateDate(DateUtil.getByTimeZone(libraryModelPointDTO.getTimeZone())); + libraryService.save(saveAsModel); + return saveAsModel; + } + @Override public LibraryModelPointVO saveOrEditTemplatePointOld(LibraryModelPointDTO libraryModelPointDTO) { // Library library = libraryService.getById(libraryModelPointDTO.getLibraryId()); From 2f59fe074fd7565f9cc23350be1da7d881315838 Mon Sep 17 00:00:00 2001 From: xupei Date: Thu, 29 Jan 2026 14:37:54 +0800 Subject: [PATCH 03/15] =?UTF-8?q?BUGFIX:=20=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=E8=BA=AB=E4=BB=BD=E4=B8=BA?= =?UTF-8?q?=E6=B8=B8=E5=AE=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ai/da/service/impl/ConvenientInquiryServiceImpl.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 7d5011a8..05b5b960 100644 --- a/src/main/java/com/ai/da/service/impl/ConvenientInquiryServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/ConvenientInquiryServiceImpl.java @@ -33,7 +33,6 @@ import io.netty.util.internal.StringUtil; import lombok.extern.slf4j.Slf4j; import org.apache.poi.xssf.usermodel.*; import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -705,14 +704,19 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl Date: Fri, 30 Jan 2026 17:10:37 +0800 Subject: [PATCH 04/15] =?UTF-8?q?BUGFIX:=20design=20single=20merge?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=E5=8F=96=E6=B6=88=E4=BC=A0=E9=80=92?= =?UTF-8?q?print=E5=8F=8Aelements=E7=AD=89=E5=85=83=E7=B4=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/python/PythonService.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index feb02dfe..22008f17 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -2851,18 +2851,19 @@ public class PythonService { gradientString = JSONObject.toJSONString(designSingleItem.getGradient()); } - PrintToPython printToPython = resolveDesignSinglePrint(designSingleItem.getPrintObject().getPrints(), + /*PrintToPython printToPython = resolveDesignSinglePrint(designSingleItem.getPrintObject().getPrints(), designSingleItem.getPartialDesign().getPartialDesignMinioPath()); resolveDesignElement(designSingleItem.getTrims(), printToPython); - log.info("组装参数【服装:{}的maskUrl: {}】",designSingleItem.getType(), designSingleItem.getMaskUrl()); + log.info("组装参数【服装:{}的maskUrl: {}】",designSingleItem.getType(), designSingleItem.getMaskUrl());*/ - String mergeImagePath = !StringUtil.isNullOrEmpty(printToPython.getPartial()) - ? printToPython.getPartial() : designSingleItem.getPath(); + String partialDesign = designSingleItem.getPartialDesign().getPartialDesignMinioPath(); + String mergeImagePath = !StringUtil.isNullOrEmpty(partialDesign) + ? partialDesign : designSingleItem.getPath(); response.add(new DesignPythonItem( designSingleItem.getType(), designSingleItem.getPath(), designSingleItem.getColor(), - printToPython, + null, // businessId designItemDetailId (python端确认没有作用,但是数据库需要存,作用:未知) // designSingleItem.getId(), businessId, From 67789abca463f8c228b159a62ab6e2106f9b634f Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 2 Feb 2026 13:32:27 +0800 Subject: [PATCH 05/15] =?UTF-8?q?TASK:getAllPose=20id=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=B1=BB=E5=9E=8B=E6=94=B9=E4=B8=BA=E6=95=B4=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/controller/GenerateController.java | 2 +- .../java/com/ai/da/service/GenerateService.java | 2 +- .../com/ai/da/service/impl/GenerateServiceImpl.java | 13 +++++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/ai/da/controller/GenerateController.java b/src/main/java/com/ai/da/controller/GenerateController.java index c5ecd7f7..a928720a 100644 --- a/src/main/java/com/ai/da/controller/GenerateController.java +++ b/src/main/java/com/ai/da/controller/GenerateController.java @@ -149,7 +149,7 @@ public class GenerateController { @Operation(summary = "获取pose transfer的所有pose") @GetMapping("/getAllPose") - public Response>> getAllPose(){ + public Response>> getAllPose(){ return Response.success(generateService.getAllPose()); } diff --git a/src/main/java/com/ai/da/service/GenerateService.java b/src/main/java/com/ai/da/service/GenerateService.java index e321d79d..7e66a14d 100644 --- a/src/main/java/com/ai/da/service/GenerateService.java +++ b/src/main/java/com/ai/da/service/GenerateService.java @@ -73,7 +73,7 @@ public interface GenerateService extends IService { SketchReconstructionVO getSketchReconstruction(Long projectId); - List> getAllPose(); + List> getAllPose(); void processPoseTransformResultBatch(String taskId, String gifUrl, String videoUrl, String imageUrl, String progress); 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 a3235f5c..dd8fc6ad 100644 --- a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java @@ -3090,14 +3090,19 @@ public class GenerateServiceImpl extends ServiceImpl i return vo; } - public List> getAllPose() { + public List> getAllPose() { List> propertyList = PoseEnum.getPropertyList(); + List> resp = new ArrayList<>(); propertyList.forEach(item -> { + HashMap temp = new HashMap<>(); + // item.put("gif", minioUtil.getPreSignedUrl(item.get("gif"), CommonConstant.MINIO_IMAGE_EXPIRE_TIME)); - item.put("video", minioUtil.getPreSignedUrl(item.get("video"), CommonConstant.MINIO_IMAGE_EXPIRE_TIME)); - item.put("firstFrame", minioUtil.getPreSignedUrl(item.get("firstFrame"), CommonConstant.MINIO_IMAGE_EXPIRE_TIME)); + temp.put("id", Integer.parseInt(item.get("id"))); + temp.put("video", minioUtil.getPreSignedUrl(item.get("video"), CommonConstant.MINIO_IMAGE_EXPIRE_TIME)); + temp.put("firstFrame", minioUtil.getPreSignedUrl(item.get("firstFrame"), CommonConstant.MINIO_IMAGE_EXPIRE_TIME)); + resp.add(temp); }); - return propertyList; + return resp; } @Override From c160da51324d9f38779e0cf8bd0598042bb1dbf2 Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 2 Feb 2026 14:57:32 +0800 Subject: [PATCH 06/15] =?UTF-8?q?BUGFIX:=20token=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=EF=BC=8C=E9=87=8D=E6=96=B0=E7=99=BB=E5=BD=95=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/service/impl/AccountServiceImpl.java | 5 +++-- src/main/resources/application-dev.properties | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java index c7543b1c..246f3e94 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -244,12 +244,13 @@ public class AccountServiceImpl extends ServiceImpl impl AccountLoginVO response = CopyUtil.copyObject(account, AccountLoginVO.class); response.setEmail(account.getUserEmail()); String token = LocalCacheUtils.getTokenCache(String.valueOf(account.getId())); - if (StringUtils.isNotBlank(token)) { + /*if (StringUtils.isNotBlank(token)) { //用户已登入 response.setToken(token); } else { response.setToken(createAccountToken(account)); - } + }*/ + response.setToken(createAccountToken(account)); response.setUserId(account.getId()); response.setSystemUser(account.getSystemUser()); // 设置头像 diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index da4dfdcb..4d24c7fd 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -17,7 +17,8 @@ spring.security.jwtSecret=JWTSECRET spring.security.jwtTokenHeader=Authorization spring.security.jwtTokenPrefix=Bearer- ## 24Сʱ -spring.security.jwtExpiration=8640000000 +#spring.security.jwtExpiration=8640000000 +spring.security.jwtExpiration=60000 #spring security权限设置 认证了token还要认证权限 不然报错Full authentication is required to access this resource spring.security.ignorePaths=/,/favicon.ico,/doc.html,/webjars/**,/swagger-resources,/v2/api-docs,\ /api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/**,/api/generate/**,/api/workspace/**,/api/classification/**,\ From 53f1b548beb0f41081f331cab037202f9d6f9ccc Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 2 Feb 2026 15:28:54 +0800 Subject: [PATCH 07/15] CONFIG --- src/main/resources/application-dev.properties | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 4d24c7fd..da4dfdcb 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -17,8 +17,7 @@ spring.security.jwtSecret=JWTSECRET spring.security.jwtTokenHeader=Authorization spring.security.jwtTokenPrefix=Bearer- ## 24Сʱ -#spring.security.jwtExpiration=8640000000 -spring.security.jwtExpiration=60000 +spring.security.jwtExpiration=8640000000 #spring security权限设置 认证了token还要认证权限 不然报错Full authentication is required to access this resource spring.security.ignorePaths=/,/favicon.ico,/doc.html,/webjars/**,/swagger-resources,/v2/api-docs,\ /api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/**,/api/generate/**,/api/workspace/**,/api/classification/**,\ From 807d802178d3f9a3f435c11bd9aa1e665170ecc8 Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 2 Feb 2026 15:30:04 +0800 Subject: [PATCH 08/15] =?UTF-8?q?TASK:motion=20=E5=8F=82=E6=95=B0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=B1=BB=E5=9E=8B=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 dd8fc6ad..53d8f93b 100644 --- a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java @@ -4300,7 +4300,7 @@ public class GenerateServiceImpl extends ServiceImpl i MotionModeEnum motionModeEnum = MotionModeEnum.of(poseTransformDTO.getMode()); switch (motionModeEnum) { case POSE_TO_VIDEO: - params.put("pose_id", poseTransformDTO.getPoseId()); + params.put("pose_id", poseTransformDTO.getPoseId().toString()); params.put("image_url", poseTransformDTO.getProductImage()); break; case PROMPT_TO_VIDEO: From a252fdf7f91597f5b3a1bf29329fc13c8b9e091f Mon Sep 17 00:00:00 2001 From: xupei Date: Tue, 3 Feb 2026 16:56:15 +0800 Subject: [PATCH 09/15] =?UTF-8?q?BUGFIX:=20detail=E4=B8=AD=E7=9A=84default?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ai/da/controller/GenerateController.java | 2 +- .../java/com/ai/da/python/PythonService.java | 23 ++++++++++++------- .../com/ai/da/service/GenerateService.java | 2 +- .../da/service/impl/GenerateServiceImpl.java | 13 ++++------- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/ai/da/controller/GenerateController.java b/src/main/java/com/ai/da/controller/GenerateController.java index a928720a..c5ecd7f7 100644 --- a/src/main/java/com/ai/da/controller/GenerateController.java +++ b/src/main/java/com/ai/da/controller/GenerateController.java @@ -149,7 +149,7 @@ public class GenerateController { @Operation(summary = "获取pose transfer的所有pose") @GetMapping("/getAllPose") - public Response>> getAllPose(){ + public Response>> getAllPose(){ return Response.success(generateService.getAllPose()); } diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 22008f17..0de18f81 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -2851,10 +2851,17 @@ public class PythonService { gradientString = JSONObject.toJSONString(designSingleItem.getGradient()); } + PrintToPython printToPython; + if (designSingleIncludeLayersDTO.getDesignType().equals("default")){ + printToPython = resolveDesignSinglePrint(designSingleItem.getPrintObject().getPrints(), + designSingleItem.getPartialDesign().getPartialDesignMinioPath()); + } else { + printToPython = null; + } /*PrintToPython printToPython = resolveDesignSinglePrint(designSingleItem.getPrintObject().getPrints(), - designSingleItem.getPartialDesign().getPartialDesignMinioPath()); - resolveDesignElement(designSingleItem.getTrims(), printToPython); - log.info("组装参数【服装:{}的maskUrl: {}】",designSingleItem.getType(), designSingleItem.getMaskUrl());*/ + designSingleItem.getPartialDesign().getPartialDesignMinioPath());*/ +// resolveDesignElement(designSingleItem.getTrims(), printToPython); + log.info("组装参数【服装:{}的maskUrl: {}】",designSingleItem.getType(), designSingleItem.getMaskUrl()); String partialDesign = designSingleItem.getPartialDesign().getPartialDesignMinioPath(); String mergeImagePath = !StringUtil.isNullOrEmpty(partialDesign) @@ -2863,7 +2870,7 @@ public class PythonService { designSingleItem.getType(), designSingleItem.getPath(), designSingleItem.getColor(), - null, + printToPython, // businessId designItemDetailId (python端确认没有作用,但是数据库需要存,作用:未知) // designSingleItem.getId(), businessId, @@ -2897,9 +2904,9 @@ public class PythonService { private PrintToPython resolveDesignSinglePrint(List printObject, String partialDesign) { PrintToPython printToPython = new PrintToPython(); - DesignPythonItemPrint printSingle = new DesignPythonItemPrint(); +// DesignPythonItemPrint printSingle = new DesignPythonItemPrint(); DesignPythonItemPrint printOverall = new DesignPythonItemPrint(); - printToPython.setSingle(printSingle); +// printToPython.setSingle(printSingle); printToPython.setOverall(printOverall); printToPython.setPartial(StringUtil.isNullOrEmpty(partialDesign) ? null : partialDesign); if (Objects.isNull(printObject) || printObject.isEmpty()){ @@ -2946,14 +2953,14 @@ public class PythonService { } // log.info("本次print打点locations###{}###fileVO{}", p.getLocation(), JSON.toJSONString(fileVO)); }); - locationS.removeAll(Collections.singleton(null)); + /*locationS.removeAll(Collections.singleton(null)); scaleS.removeAll(Collections.singleton(null)); angleS.removeAll(Collections.singleton(null)); pathsS.removeAll(Collections.singleton(null)); printSingle.setLocation(locationS); printSingle.setPrint_scale_list(scaleS); printSingle.setPrint_angle_list(angleS); - printSingle.setPrint_path_list(pathsS); + printSingle.setPrint_path_list(pathsS);*/ locationO.removeAll(Collections.singleton(null)); scaleO.removeAll(Collections.singleton(null)); diff --git a/src/main/java/com/ai/da/service/GenerateService.java b/src/main/java/com/ai/da/service/GenerateService.java index 7e66a14d..e321d79d 100644 --- a/src/main/java/com/ai/da/service/GenerateService.java +++ b/src/main/java/com/ai/da/service/GenerateService.java @@ -73,7 +73,7 @@ public interface GenerateService extends IService { SketchReconstructionVO getSketchReconstruction(Long projectId); - List> getAllPose(); + List> getAllPose(); void processPoseTransformResultBatch(String taskId, String gifUrl, String videoUrl, String imageUrl, String progress); 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 53d8f93b..8c25c7fc 100644 --- a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java @@ -3090,19 +3090,14 @@ public class GenerateServiceImpl extends ServiceImpl i return vo; } - public List> getAllPose() { + public List> getAllPose() { List> propertyList = PoseEnum.getPropertyList(); - List> resp = new ArrayList<>(); propertyList.forEach(item -> { - HashMap temp = new HashMap<>(); - // item.put("gif", minioUtil.getPreSignedUrl(item.get("gif"), CommonConstant.MINIO_IMAGE_EXPIRE_TIME)); - temp.put("id", Integer.parseInt(item.get("id"))); - temp.put("video", minioUtil.getPreSignedUrl(item.get("video"), CommonConstant.MINIO_IMAGE_EXPIRE_TIME)); - temp.put("firstFrame", minioUtil.getPreSignedUrl(item.get("firstFrame"), CommonConstant.MINIO_IMAGE_EXPIRE_TIME)); - resp.add(temp); + item.put("video", minioUtil.getPreSignedUrl(item.get("video"), CommonConstant.MINIO_IMAGE_EXPIRE_TIME)); + item.put("firstFrame", minioUtil.getPreSignedUrl(item.get("firstFrame"), CommonConstant.MINIO_IMAGE_EXPIRE_TIME)); }); - return resp; + return propertyList; } @Override From 1decd8e258fe001dffea17954e0277be8215138d Mon Sep 17 00:00:00 2001 From: litianxiang Date: Wed, 4 Feb 2026 13:41:09 +0800 Subject: [PATCH 10/15] =?UTF-8?q?=E5=8F=82=E8=B5=9B=E9=80=89=E6=89=8B?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E7=BC=96=E5=8F=B7=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../security/filter/AuthenticationFilter.java | 2 +- .../da/controller/GlobalAwardController.java | 8 ++ .../com/ai/da/service/GlobalAwardService.java | 11 ++ .../service/impl/GlobalAwardServiceImpl.java | 123 ++++++++++++++++++ .../primary/WorkspaceRelStyleMapper.xml | 1 + 5 files changed, 144 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 1b3d80e5..3dc70417 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 @@ -63,7 +63,7 @@ public class AuthenticationFilter extends OncePerRequestFilter { //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/save", "/api/global-award/contestants/by-email", "/api/global-award/checkEmail", "/api/global-award/checkCode","/api/global-award/contestants/export" ); @Override diff --git a/src/main/java/com/ai/da/controller/GlobalAwardController.java b/src/main/java/com/ai/da/controller/GlobalAwardController.java index 10879652..1e8eb00b 100644 --- a/src/main/java/com/ai/da/controller/GlobalAwardController.java +++ b/src/main/java/com/ai/da/controller/GlobalAwardController.java @@ -163,6 +163,14 @@ public class GlobalAwardController { return Response.success(globalAwardService.checkCode(email, code)); } + @GetMapping("/contestants/export") + @ApiOperation(value = "导出参赛者列表为Excel", notes = "导出所有参赛者信息为xlsx并触发下载") + public Response exportContestants() throws Exception { + // 将文件保存到服务端本地目录(uploadDir/exports),不返回文件内容给客户端 + globalAwardService.saveContestantsToLocal(); + return Response.success(); + } + } diff --git a/src/main/java/com/ai/da/service/GlobalAwardService.java b/src/main/java/com/ai/da/service/GlobalAwardService.java index 583cf321..b21cfc36 100644 --- a/src/main/java/com/ai/da/service/GlobalAwardService.java +++ b/src/main/java/com/ai/da/service/GlobalAwardService.java @@ -20,6 +20,17 @@ public interface GlobalAwardService { CheckOTPVO checkCode(String email, String otp); void checkSecurityToken(String email, String securityToken); + + /** + * 导出参赛者列表为 Excel(二进制) + * @return Excel 文件的字节数组 + */ + byte[] exportContestants() throws Exception; + + /** + * 将参赛者列表导出并保存到服务端本地目录(使用服务配置的 uploadDir/exports) + */ + void saveContestantsToLocal() 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 8fbc5e38..d29d4d9d 100644 --- a/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java @@ -22,6 +22,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; +import org.springframework.transaction.annotation.Transactional; import jakarta.annotation.Resource; @@ -29,6 +30,20 @@ import java.io.IOException; 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 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 @@ -128,6 +143,7 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { } @Override + @Transactional(rollbackFor = Exception.class) public Map saveContestant(ContestantDTO request) { Map resp = new HashMap<>(); if (request.getEmail() == null) { @@ -142,7 +158,14 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { LocalDateTime now = LocalDateTime.now(); if (existing == null) { + // 生成唯一的参赛选手编号(从10000开始),使用数据库行锁保证并发安全与原子性 + QueryWrapper numQw = new QueryWrapper<>(); + numQw.isNotNull("contestant_number").orderByDesc("contestant_number").last("FOR UPDATE"); + Contestant maxRow = contestantMapper.selectOne(numQw); + Integer nextContestantNumber = (maxRow == null || maxRow.getContestantNumber() == null) ? 10000 : maxRow.getContestantNumber() + 1; + Contestant toInsert = Contestant.builder() + .contestantNumber(nextContestantNumber) .email(request.getEmail()) .firstName(request.getFirstName()) .lastName(request.getLastName()) @@ -160,6 +183,7 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { .build(); contestantMapper.insert(toInsert); resp.put("success", true); + resp.put("contestant_number", nextContestantNumber); sendSiteMsg(toInsert.getId(), toInsert.getEmail()); return resp; } else { @@ -178,10 +202,109 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { existing.setUpdatedAt(now); contestantMapper.updateById(existing); resp.put("success", true); + resp.put("contestant_number", existing.getContestantNumber()); return resp; } } + @Override + public byte[] exportContestants() throws Exception { + List list = contestantMapper.selectList(new QueryWrapper<>()); + try (XSSFWorkbook workbook = new XSSFWorkbook(); ByteArrayOutputStream out = new ByteArrayOutputStream()) { + Sheet sheet = workbook.createSheet("contestants"); + int rowIdx = 0; + Row header = sheet.createRow(rowIdx++); + String[] headers = new String[] { + "contestantNumber", "email", "firstName", "lastName", "gender", "occupation", + "age", "countryRegionCity", "phoneNumber", "designTitle", "designDescription", + "pdfPath", "videoPath", "createdAt", "updatedAt" + }; + for (int i = 0; i < headers.length; i++) { + Cell c = header.createCell(i); + c.setCellValue(headers[i]); + } + + for (Contestant cst : list) { + Row r = sheet.createRow(rowIdx++); + int ci = 0; + r.createCell(ci++).setCellValue(cst.getContestantNumber() == null ? "" : cst.getContestantNumber().toString()); + r.createCell(ci++).setCellValue(cst.getEmail() == null ? "" : cst.getEmail()); + r.createCell(ci++).setCellValue(cst.getFirstName() == null ? "" : cst.getFirstName()); + r.createCell(ci++).setCellValue(cst.getLastName() == null ? "" : cst.getLastName()); + r.createCell(ci++).setCellValue(cst.getGender() == null ? "" : cst.getGender()); + r.createCell(ci++).setCellValue(cst.getOccupation() == null ? "" : cst.getOccupation()); + r.createCell(ci++).setCellValue(cst.getAge() == null ? "" : cst.getAge().toString()); + r.createCell(ci++).setCellValue(cst.getCountryRegionCity() == null ? "" : cst.getCountryRegionCity()); + 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.getCreatedAt() == null ? "" : cst.getCreatedAt().toString()); + r.createCell(ci++).setCellValue(cst.getUpdatedAt() == null ? "" : cst.getUpdatedAt().toString()); + } + + workbook.write(out); + out.flush(); + return out.toByteArray(); + } catch (IOException e) { + log.error("export contestants failed", e); + throw e; + } + } + + @Override + public void saveContestantsToLocal() throws Exception { + List list = contestantMapper.selectList(new QueryWrapper<>()); + DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyyMMdd_HHmmss"); + String ts = LocalDateTime.now().format(fmt); + Path exportDir = Paths.get(uploadDir == null ? "uploads" : uploadDir, "exports"); + Files.createDirectories(exportDir); + Path outPath = exportDir.resolve("contestants_" + ts + ".xlsx"); + + try (XSSFWorkbook workbook = new XSSFWorkbook(); FileOutputStream fos = new FileOutputStream(outPath.toFile())) { + Sheet sheet = workbook.createSheet("contestants"); + int rowIdx = 0; + Row header = sheet.createRow(rowIdx++); + String[] headers = new String[] { + "contestantNumber", "email", "firstName", "lastName", "gender", "occupation", + "age", "countryRegionCity", "phoneNumber", "designTitle", "designDescription", + "pdfPath", "videoPath", "createdAt", "updatedAt" + }; + for (int i = 0; i < headers.length; i++) { + Cell c = header.createCell(i); + c.setCellValue(headers[i]); + } + + for (Contestant cst : list) { + Row r = sheet.createRow(rowIdx++); + int ci = 0; + r.createCell(ci++).setCellValue(cst.getContestantNumber() == null ? "" : cst.getContestantNumber().toString()); + r.createCell(ci++).setCellValue(cst.getEmail() == null ? "" : cst.getEmail()); + r.createCell(ci++).setCellValue(cst.getFirstName() == null ? "" : cst.getFirstName()); + r.createCell(ci++).setCellValue(cst.getLastName() == null ? "" : cst.getLastName()); + r.createCell(ci++).setCellValue(cst.getGender() == null ? "" : cst.getGender()); + r.createCell(ci++).setCellValue(cst.getOccupation() == null ? "" : cst.getOccupation()); + r.createCell(ci++).setCellValue(cst.getAge() == null ? "" : cst.getAge().toString()); + r.createCell(ci++).setCellValue(cst.getCountryRegionCity() == null ? "" : cst.getCountryRegionCity()); + 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.getCreatedAt() == null ? "" : cst.getCreatedAt().toString()); + r.createCell(ci++).setCellValue(cst.getUpdatedAt() == null ? "" : cst.getUpdatedAt().toString()); + } + + workbook.write(fos); + fos.flush(); + log.info("Exported contestants to local file: {}", outPath.toString()); + } catch (IOException e) { + log.error("save contestants to local failed", e); + throw e; + } + } + @Override public ContestantDTO getContestantByID(String id) { if (id == null) { diff --git a/src/main/resources/mapper/primary/WorkspaceRelStyleMapper.xml b/src/main/resources/mapper/primary/WorkspaceRelStyleMapper.xml index e65cd83b..03fbe225 100644 --- a/src/main/resources/mapper/primary/WorkspaceRelStyleMapper.xml +++ b/src/main/resources/mapper/primary/WorkspaceRelStyleMapper.xml @@ -17,3 +17,4 @@ + From b826f0bf39289cae9fb1918fce828a095d32552b Mon Sep 17 00:00:00 2001 From: litianxiang Date: Wed, 4 Feb 2026 13:41:16 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E5=8F=82=E8=B5=9B=E9=80=89=E6=89=8B?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E7=BC=96=E5=8F=B7=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/mapper/primary/entity/Contestant.java | 3 +++ 1 file changed, 3 insertions(+) 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 8c79b51f..afa8a803 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 @@ -26,6 +26,9 @@ public class Contestant { private String email; + @TableField("contestant_number") + private Integer contestantNumber; + @TableField("first_name") private String firstName; From d63b4b4e63aeb9b6f5c4692de3b39e2e1df11b2a Mon Sep 17 00:00:00 2001 From: litianxiang Date: Wed, 4 Feb 2026 14:03:30 +0800 Subject: [PATCH 12/15] =?UTF-8?q?fix:=E5=8F=82=E8=B5=9B=E9=80=89=E6=89=8B?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E7=BC=96=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ai/da/service/impl/GlobalAwardServiceImpl.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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 d29d4d9d..307b84e1 100644 --- a/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java @@ -158,14 +158,8 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { LocalDateTime now = LocalDateTime.now(); if (existing == null) { - // 生成唯一的参赛选手编号(从10000开始),使用数据库行锁保证并发安全与原子性 - QueryWrapper numQw = new QueryWrapper<>(); - numQw.isNotNull("contestant_number").orderByDesc("contestant_number").last("FOR UPDATE"); - Contestant maxRow = contestantMapper.selectOne(numQw); - Integer nextContestantNumber = (maxRow == null || maxRow.getContestantNumber() == null) ? 10000 : maxRow.getContestantNumber() + 1; - + // 由数据库自增分配 contestant_number(请确保数据库列为 AUTO_INCREMENT) Contestant toInsert = Contestant.builder() - .contestantNumber(nextContestantNumber) .email(request.getEmail()) .firstName(request.getFirstName()) .lastName(request.getLastName()) @@ -182,8 +176,11 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { .updatedAt(now) .build(); contestantMapper.insert(toInsert); + // 重新查询以获取数据库分配的 contestant_number + Contestant saved = contestantMapper.selectById(toInsert.getId()); + Integer assignedNumber = (saved == null) ? null : saved.getContestantNumber(); resp.put("success", true); - resp.put("contestant_number", nextContestantNumber); + resp.put("contestant_number", assignedNumber); sendSiteMsg(toInsert.getId(), toInsert.getEmail()); return resp; } else { From 8c007077a3e04ee98462f9148b6dbe3b7680a850 Mon Sep 17 00:00:00 2001 From: xupei Date: Wed, 4 Feb 2026 14:43:29 +0800 Subject: [PATCH 13/15] =?UTF-8?q?BUGFIX:=20detail=E4=B8=AD=E7=9A=84merge?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=E6=B2=A1=E6=9C=89=E5=AD=98=E5=82=A8?= =?UTF-8?q?partialDesign=E7=9A=84=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/python/PythonService.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 0de18f81..5ef07e16 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -2852,12 +2852,8 @@ public class PythonService { } PrintToPython printToPython; - if (designSingleIncludeLayersDTO.getDesignType().equals("default")){ - printToPython = resolveDesignSinglePrint(designSingleItem.getPrintObject().getPrints(), - designSingleItem.getPartialDesign().getPartialDesignMinioPath()); - } else { - printToPython = null; - } + printToPython = resolveDesignSinglePrint(designSingleItem.getPrintObject().getPrints(), + designSingleItem.getPartialDesign().getPartialDesignMinioPath()); /*PrintToPython printToPython = resolveDesignSinglePrint(designSingleItem.getPrintObject().getPrints(), designSingleItem.getPartialDesign().getPartialDesignMinioPath());*/ // resolveDesignElement(designSingleItem.getTrims(), printToPython); From d1123aedcc95a019844d3dc9108e01c6614427e6 Mon Sep 17 00:00:00 2001 From: litianxiang Date: Wed, 4 Feb 2026 14:45:11 +0800 Subject: [PATCH 14/15] =?UTF-8?q?fix:=E5=AF=BC=E5=87=BA=E4=B8=BA=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/controller/GlobalAwardController.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/ai/da/controller/GlobalAwardController.java b/src/main/java/com/ai/da/controller/GlobalAwardController.java index 1e8eb00b..2206dc4d 100644 --- a/src/main/java/com/ai/da/controller/GlobalAwardController.java +++ b/src/main/java/com/ai/da/controller/GlobalAwardController.java @@ -11,6 +11,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -165,10 +166,13 @@ public class GlobalAwardController { @GetMapping("/contestants/export") @ApiOperation(value = "导出参赛者列表为Excel", notes = "导出所有参赛者信息为xlsx并触发下载") - public Response exportContestants() throws Exception { - // 将文件保存到服务端本地目录(uploadDir/exports),不返回文件内容给客户端 - globalAwardService.saveContestantsToLocal(); - return Response.success(); + public void exportContestants(HttpServletResponse response) throws Exception { + byte[] data = globalAwardService.exportContestants(); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader("Content-Disposition", "attachment; filename=\"contestants.xlsx\""); + response.setContentLength(data.length); + response.getOutputStream().write(data); + response.getOutputStream().flush(); } } From 9251df49f829b24d1df83e5d124aaa5956354ef9 Mon Sep 17 00:00:00 2001 From: litianxiang Date: Wed, 4 Feb 2026 15:27:51 +0800 Subject: [PATCH 15/15] =?UTF-8?q?=E6=AF=94=E8=B5=9B=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=A7=E5=B0=8F=E5=92=8C=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=97=B6=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../da/mapper/primary/entity/Contestant.java | 9 ++++ .../com/ai/da/model/dto/ContestantDTO.java | 11 +++++ .../service/impl/GlobalAwardServiceImpl.java | 48 ++++++++++++++++--- 3 files changed, 62 insertions(+), 6 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 afa8a803..0e7241bb 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 @@ -59,6 +59,15 @@ public class Contestant { @TableField("video_path") private String videoPath; + @TableField("video_duration") + private Integer videoDuration; + + @TableField("video_size") + private Long videoSize; + + @TableField("pdf_size") + private Long pdfSize; + @TableField("created_at") private LocalDateTime createdAt; diff --git a/src/main/java/com/ai/da/model/dto/ContestantDTO.java b/src/main/java/com/ai/da/model/dto/ContestantDTO.java index 57342903..1390c819 100644 --- a/src/main/java/com/ai/da/model/dto/ContestantDTO.java +++ b/src/main/java/com/ai/da/model/dto/ContestantDTO.java @@ -49,6 +49,15 @@ public class ContestantDTO { @ApiModelProperty(value = "视频文件路径", required = false, example = "contestants/user@example.com/2024/01/video_1234567890.mp4") private String videoPath; + + @ApiModelProperty(value = "视频时长(秒)", required = false, example = "120") + private Integer videoDuration; + + @ApiModelProperty(value = "视频大小(字节)", required = false, example = "10485760") + private Long videoSize; + + @ApiModelProperty(value = "PDF 文件大小(字节)", required = false, example = "524288") + private Long pdfSize; // /** // * 是否确认覆盖已存在记录(false 表示发现已有记录时仅返回 existingRecord,不覆盖) @@ -58,6 +67,8 @@ public class ContestantDTO { @NotBlank private String secureToken; + + } 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 307b84e1..948529d6 100644 --- a/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java @@ -172,6 +172,9 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { .designDescription(request.getDesignDescription()) .pdfPath(request.getPdfPath()) .videoPath(request.getVideoPath()) + .videoDuration(request.getVideoDuration()) + .videoSize(request.getVideoSize()) + .pdfSize(request.getPdfSize()) .createdAt(now) .updatedAt(now) .build(); @@ -196,6 +199,9 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { existing.setDesignDescription(request.getDesignDescription()); existing.setPdfPath(request.getPdfPath()); existing.setVideoPath(request.getVideoPath()); + existing.setVideoDuration(request.getVideoDuration()); + existing.setVideoSize(request.getVideoSize()); + existing.setPdfSize(request.getPdfSize()); existing.setUpdatedAt(now); contestantMapper.updateById(existing); resp.put("success", true); @@ -214,7 +220,7 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { String[] headers = new String[] { "contestantNumber", "email", "firstName", "lastName", "gender", "occupation", "age", "countryRegionCity", "phoneNumber", "designTitle", "designDescription", - "pdfPath", "videoPath", "createdAt", "updatedAt" + "pdfPath", "videoPath", "videoDuration", "videoSizeMB", "pdfSizeMB", "createdAt", "updatedAt" }; for (int i = 0; i < headers.length; i++) { Cell c = header.createCell(i); @@ -235,8 +241,23 @@ 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 { + double vMb = cst.getVideoSize() / 1024.0 / 1024.0; + r.createCell(ci++).setCellValue(String.format("%.2f", vMb)); + } + if (cst.getPdfSize() == null) { + r.createCell(ci++).setCellValue(""); + } else { + double pMb = cst.getPdfSize() / 1024.0 / 1024.0; + r.createCell(ci++).setCellValue(String.format("%.2f", pMb)); + } r.createCell(ci++).setCellValue(cst.getCreatedAt() == null ? "" : cst.getCreatedAt().toString()); r.createCell(ci++).setCellValue(cst.getUpdatedAt() == null ? "" : cst.getUpdatedAt().toString()); } @@ -266,7 +287,7 @@ public class GlobalAwardServiceImpl implements GlobalAwardService { String[] headers = new String[] { "contestantNumber", "email", "firstName", "lastName", "gender", "occupation", "age", "countryRegionCity", "phoneNumber", "designTitle", "designDescription", - "pdfPath", "videoPath", "createdAt", "updatedAt" + "pdfPath", "videoPath", "videoDuration", "videoSizeMB", "pdfSizeMB", "createdAt", "updatedAt" }; for (int i = 0; i < headers.length; i++) { Cell c = header.createCell(i); @@ -287,8 +308,23 @@ 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 { + double vMb = cst.getVideoSize() / 1024.0 / 1024.0; + r.createCell(ci++).setCellValue(String.format("%.2f", vMb)); + } + if (cst.getPdfSize() == null) { + r.createCell(ci++).setCellValue(""); + } else { + double pMb = cst.getPdfSize() / 1024.0 / 1024.0; + r.createCell(ci++).setCellValue(String.format("%.2f", pMb)); + } r.createCell(ci++).setCellValue(cst.getCreatedAt() == null ? "" : cst.getCreatedAt().toString()); r.createCell(ci++).setCellValue(cst.getUpdatedAt() == null ? "" : cst.getUpdatedAt().toString()); }