From c4a37f5d73a3eece4345caaa1b4c6955fc60dc80 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Mon, 20 May 2024 09:34:20 +0800 Subject: [PATCH 1/9] =?UTF-8?q?TASK:=E9=82=AE=E4=BB=B6;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/common/config/MyTaskScheduler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 6e443ba9..647c0f38 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -68,7 +68,7 @@ public class MyTaskScheduler { } } } - @Scheduled(cron = "0 0 8 * * ?") +// @Scheduled(cron = "0 0 8 * * ?") public void sendTrialOrderExcelToManagements() { // 获取前一天日期 LocalDate yesterday = LocalDate.now().minusDays(1); From f9ce5599152560298ca75ae904e8bf4157dfbf3d Mon Sep 17 00:00:00 2001 From: xupei Date: Tue, 21 May 2024 14:40:46 +0800 Subject: [PATCH 2/9] =?UTF-8?q?paypal=20=E5=88=87=E6=8D=A2=E5=9B=9Esandbox?= =?UTF-8?q?=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/paypal-sandbox.properties | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/resources/paypal-sandbox.properties b/src/main/resources/paypal-sandbox.properties index 3b0eaef2..8c1e7208 100644 --- a/src/main/resources/paypal-sandbox.properties +++ b/src/main/resources/paypal-sandbox.properties @@ -9,15 +9,15 @@ #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=41L14847MC833625B \ No newline at end of file +#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=41L14847MC833625B \ No newline at end of file From 890389843fc14865c16bf4864a1c873b973e99cc Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Tue, 28 May 2024 10:43:50 +0800 Subject: [PATCH 3/9] =?UTF-8?q?BUGFIX:=E8=AF=95=E7=94=A8=E6=97=B6=E9=97=B4?= =?UTF-8?q?link14=E5=A4=A9;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/common/utils/SendEmailUtil.java | 11 ++++++--- .../com/ai/da/model/dto/AccountTrialDTO.java | 2 +- .../da/service/impl/AccountServiceImpl.java | 24 ++++++++++++++----- 3 files changed, 27 insertions(+), 10 deletions(-) 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 73c4eb17..08f1e075 100644 --- a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java +++ b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java @@ -136,7 +136,7 @@ public class SendEmailUtil { private final static Long TRIAL_ORDER_LIST_ID = 122273L; private final static Long NO_TRIAL_ORDER_LIST_ID = 122591L; - public static void sendCustomEmail(String receiverAddress, String senderAddress, TrialOrder trialOrder, int emailType, String country) { + public static void sendCustomEmail(String receiverAddress, String senderAddress, TrialOrder trialOrder, int emailType, String country, boolean link) { try { // 实例化一个认证对象 Credential cred = new Credential(SECRET_ID, SECRET_KEy); @@ -173,7 +173,7 @@ public class SendEmailUtil { }else { template.setTemplateID(NOTIFICATION_TEMPLATE_ID); } - template.setTemplateData(buildNotificationData(trialOrder)); + template.setTemplateData(buildNotificationData(trialOrder, link)); break; default: break; @@ -345,7 +345,7 @@ public class SendEmailUtil { } // 构建试用订单通过通知数据 - private static String buildNotificationData(TrialOrder trialOrder) { + private static String buildNotificationData(TrialOrder trialOrder, boolean link) { JSONObject jsonObject = new JSONObject(); // 设置试用订单通过通知相关数据 jsonObject.put("title", trialOrder.getTitle()); @@ -353,6 +353,11 @@ public class SendEmailUtil { jsonObject.put("givenName", trialOrder.getGivenName()); jsonObject.put("userName", trialOrder.getUserName()); jsonObject.put("email", trialOrder.getEmail()); + if (link) { + jsonObject.put("days", 14); + }else { + jsonObject.put("days", 5); + } return jsonObject.toJSONString(); } diff --git a/src/main/java/com/ai/da/model/dto/AccountTrialDTO.java b/src/main/java/com/ai/da/model/dto/AccountTrialDTO.java index 700426a2..c4ef92a9 100644 --- a/src/main/java/com/ai/da/model/dto/AccountTrialDTO.java +++ b/src/main/java/com/ai/da/model/dto/AccountTrialDTO.java @@ -9,5 +9,5 @@ import lombok.EqualsAndHashCode; @Data @ApiModel("AccountTrial") public class AccountTrialDTO extends TrialOrder { - + private String ref; } 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 57300f41..15fc5884 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -468,6 +468,10 @@ public class AccountServiceImpl extends ServiceImpl impl public Boolean addTrialUser(AccountTrialDTO accountTrialDTO, HttpServletRequest request) { // 获取用户申请试用IP String ipAddress = RequestInfoUtil.getIpAddress(request); + boolean link = false; + if (StringUtils.isNotBlank(accountTrialDTO.getRef())) { + link = true; + } // 先检测试用订单 QueryWrapper trialOrderQueryWrapper = new QueryWrapper<>(); trialOrderQueryWrapper.eq("BINARY email", accountTrialDTO.getEmail()); @@ -515,7 +519,11 @@ public class AccountServiceImpl extends ServiceImpl impl account.setIsTrial(1); account.setIsBeginner(1); account.setValidStartTime(System.currentTimeMillis()); - account.setValidEndTime(Instant.now().plus(5, ChronoUnit.DAYS).toEpochMilli()); + if (link) { + account.setValidEndTime(Instant.now().plus(14, ChronoUnit.DAYS).toEpochMilli()); + }else { + account.setValidEndTime(Instant.now().plus(5, ChronoUnit.DAYS).toEpochMilli()); + } accountMapper.updateById(account); }else { account.setUserName(trialOrder.getUserName()); @@ -523,7 +531,11 @@ public class AccountServiceImpl extends ServiceImpl impl account.setUserEmail(trialOrder.getEmail()); account.setLanguage(Language.ENGLISH.name()); account.setValidStartTime(System.currentTimeMillis()); - account.setValidEndTime(Instant.now().plus(5, ChronoUnit.DAYS).toEpochMilli()); + if (link) { + account.setValidEndTime(Instant.now().plus(14, ChronoUnit.DAYS).toEpochMilli()); + }else { + account.setValidEndTime(Instant.now().plus(5, ChronoUnit.DAYS).toEpochMilli()); + } account.setCreateDate(new Date()); account.setIsTrial(1); account.setIsBeginner(1); @@ -534,9 +546,9 @@ public class AccountServiceImpl extends ServiceImpl impl // SendEmailUtil.sendCustomEmail("calvinwong@aidlab.hk", null, trialOrder,2); // SendEmailUtil.sendCustomEmail("kaicpang.pang@connect.polyu.hk", null, trialOrder,2); if (trialOrder.getCountry().equals("China")) { - SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry()); + SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry(), link); }else { - SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry()); + SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry(), link); } } return Boolean.TRUE; @@ -586,9 +598,9 @@ public class AccountServiceImpl extends ServiceImpl impl // SendEmailUtil.sendCustomEmail("calvinwong@aidlab.hk", null, trialOrder,2, trialOrder.getCountry()); // SendEmailUtil.sendCustomEmail("kaicpang.pang@connect.polyu.hk", null, trialOrder,2, trialOrder.getCountry()); if (trialOrder.getCountry().equals("China")) { - SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry()); + SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry(), false); }else { - SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry()); + SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry(), false); } } return Boolean.TRUE; From fb8de15eca95acec19bafce5105e080bfc5334c9 Mon Sep 17 00:00:00 2001 From: xupei Date: Tue, 28 May 2024 11:17:46 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E4=B8=8D=E7=AD=89=E6=AF=94=E7=BC=A9?= =?UTF-8?q?=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../da/common/RabbitMQ/GenerateConsumer.java | 118 +++++++++--------- .../com/ai/da/common/RabbitMQ/MQConfig.java | 8 +- .../com/ai/da/common/RabbitMQ/SRConsumer.java | 24 ++-- .../com/ai/da/common/task/PaypalTask.java | 2 +- .../resources/application-prod.properties | 3 +- src/main/resources/application.properties | 4 +- 6 files changed, 80 insertions(+), 79 deletions(-) diff --git a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java index 876dfd2c..3e8e6a6e 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/GenerateConsumer.java @@ -154,63 +154,63 @@ public class GenerateConsumer { } -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer1(Message msg, Channel channel) { -// generate(msg, channel, "consumer 1"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer2(Message msg, Channel channel) { -// generate(msg, channel, "consumer 2"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer3(Message msg, Channel channel) { -// generate(msg, channel, "consumer 3"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer4(Message msg, Channel channel) { -// generate(msg, channel, "consumer 4"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer5(Message msg, Channel channel) { -// generate(msg, channel, "consumer 5"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer6(Message msg, Channel channel) { -// generate(msg, channel, "consumer 6"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer7(Message msg, Channel channel) { -// generate(msg, channel, "consumer 7"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer8(Message msg, Channel channel) { -// generate(msg, channel, "consumer 8"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_QUEUE) -// @RabbitHandler -// public void generateConsumer9(Message msg, Channel channel) { -// generate(msg, channel, "consumer 9"); -// } -// -// @RabbitListener(queues = MQConfig.GENERATE_RESULT_QUEUE) -// @RabbitHandler -// public void getGenerateResult(Message msg, Channel channel) { -// processGenerateResult(msg, channel); -// } + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer1(Message msg, Channel channel) { + generate(msg, channel, "consumer 1"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer2(Message msg, Channel channel) { + generate(msg, channel, "consumer 2"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer3(Message msg, Channel channel) { + generate(msg, channel, "consumer 3"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer4(Message msg, Channel channel) { + generate(msg, channel, "consumer 4"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer5(Message msg, Channel channel) { + generate(msg, channel, "consumer 5"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer6(Message msg, Channel channel) { + generate(msg, channel, "consumer 6"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer7(Message msg, Channel channel) { + generate(msg, channel, "consumer 7"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer8(Message msg, Channel channel) { + generate(msg, channel, "consumer 8"); + } + + @RabbitListener(queues = MQConfig.GENERATE_QUEUE) + @RabbitHandler + public void generateConsumer9(Message msg, Channel channel) { + generate(msg, channel, "consumer 9"); + } + + @RabbitListener(queues = MQConfig.GENERATE_RESULT_QUEUE) + @RabbitHandler + public void getGenerateResult(Message msg, Channel channel) { + processGenerateResult(msg, channel); + } } diff --git a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java index 7079f02a..637fc94e 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java @@ -12,16 +12,16 @@ public class MQConfig { // public static final String GENERATE_QUEUE = "generate-queue-test"; // ================================================================== // public static final String GENERATE_QUEUE = "generate-queue-local"; - public static final String GENERATE_QUEUE = "generate-queue-dev"; + public static final String GENERATE_QUEUE = "generate-queue-prod"; // public static final String SR_QUEUE = "SR-queue-local"; - public static final String SR_QUEUE = "SR-queue-dev"; + public static final String SR_QUEUE = "SR-queue-prod"; // public static final String SR_RESULT_QUEUE = "SuperResolution-local"; - public static final String SR_RESULT_QUEUE = "SuperResolution-dev"; + public static final String SR_RESULT_QUEUE = "SuperResolution-prod"; // public static final String GENERATE_RESULT_QUEUE = "GenerateImage-local"; - public static final String GENERATE_RESULT_QUEUE = "GenerateImage-dev"; + public static final String GENERATE_RESULT_QUEUE = "GenerateImage-prod"; public MQConfig() { } diff --git a/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java b/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java index b8ba32f2..6ad261bd 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/SRConsumer.java @@ -218,17 +218,17 @@ public class SRConsumer { taskListService.updateTaskStatusOrOutputRedis(uniqueId, "fail", null); } -// @RabbitListener(queues = MQConfig.SR_QUEUE) -// @RabbitHandler -// public void SRConsumer1(Message msg, Channel channel) { -// superResolution(msg, channel, "consumer 1"); -// } -// -// -// @RabbitListener(queues = MQConfig.SR_RESULT_QUEUE) -// @RabbitHandler -// public void SRResultConsumer1(Message msg, Channel channel) { -// getSRResult(msg, channel, "consumer 1"); -// } + @RabbitListener(queues = MQConfig.SR_QUEUE) + @RabbitHandler + public void SRConsumer1(Message msg, Channel channel) { + superResolution(msg, channel, "consumer 1"); + } + + + @RabbitListener(queues = MQConfig.SR_RESULT_QUEUE) + @RabbitHandler + public void SRResultConsumer1(Message msg, Channel channel) { + getSRResult(msg, channel, "consumer 1"); + } } diff --git a/src/main/java/com/ai/da/common/task/PaypalTask.java b/src/main/java/com/ai/da/common/task/PaypalTask.java index 65d5b8a3..bc0e24dd 100644 --- a/src/main/java/com/ai/da/common/task/PaypalTask.java +++ b/src/main/java/com/ai/da/common/task/PaypalTask.java @@ -23,7 +23,7 @@ public class PaypalTask { @Resource private PayPalCheckoutService payPalCheckoutService; -// @Scheduled(cron = "0/30 * * * * ?") + @Scheduled(cron = "0/30 * * * * ?") public void orderConfirm() throws SerializeException { log.info("PayPal orderConfirm 被执行......"); diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index 20d02502..3cc7c70e 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -58,6 +58,7 @@ minio.bucketName.results=aida-results minio.bucketName.sysImage=aida-sys-image minio.bucketName.users=aida-users minio.bucketName.collectionElement=aida-collection-element +minio.bucketName.gradient=aida-gradient redirect_url=http://18.167.251.121:7788 spring.rabbitmq.host=18.167.251.121 @@ -69,7 +70,7 @@ spring.rabbitmq.virtual-host=/ spring.redis.host=172.31.11.32 #spring.redis.host=18.167.251.121 spring.redis.port=6379 -spring.redis.database=1 +spring.redis.database=2 spring.redis.password=Aidlab spring.redis.lettuce.pool.max-active=8 spring.redis.lettuce.pool.max-idle=8 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 From 709393a9a630a3219fd9dc7923a5a9b1313a7ec5 Mon Sep 17 00:00:00 2001 From: xupei Date: Tue, 28 May 2024 11:20:58 +0800 Subject: [PATCH 5/9] =?UTF-8?q?paypal=20=E5=88=87=E6=8D=A2=E4=B8=BAlive?= =?UTF-8?q?=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/paypal-sandbox.properties | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/resources/paypal-sandbox.properties b/src/main/resources/paypal-sandbox.properties index 54d6b93d..e6c46b5e 100644 --- a/src/main/resources/paypal-sandbox.properties +++ b/src/main/resources/paypal-sandbox.properties @@ -9,16 +9,16 @@ #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.client-id=ASWSIZ3MXJU5w5VOeOHeigWcSw6iinl30ZCipruziKpHclxP0ryf8-7VKG1Ba2VwZwa2DMvGEzTfCTgz +paypal.client-secret=EHQg_K5PSqmp4FJlzEcOEH_kFkmq4aBzaI7jridw53L6cOQRULBAnfv2KakRfrsqaU1PDSkO4Co9Vyxc +paypal.receiver.email=kimwong@code-create.com.hk +paypal.mode=live #paypal.webhook_id=41L14847MC833625B -#paypal.webhook_id=1D107312EX592781K \ No newline at end of file +paypal.webhook_id=1D107312EX592781K \ No newline at end of file From 40aad9d1a30cf690b8219da375f753b21c6366c0 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Tue, 28 May 2024 11:32:49 +0800 Subject: [PATCH 6/9] =?UTF-8?q?BUGFIX:=E6=B8=90=E5=8F=98=E8=89=B2=E5=9B=9E?= =?UTF-8?q?=E9=80=80;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../primary/entity/CollectionElement.java | 2 +- .../ai/da/model/dto/CollectionColorDTO.java | 6 ++-- .../java/com/ai/da/python/PythonService.java | 12 +++---- .../impl/CollectionElementServiceImpl.java | 36 +++++++++---------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/ai/da/mapper/primary/entity/CollectionElement.java b/src/main/java/com/ai/da/mapper/primary/entity/CollectionElement.java index fa3a6df0..764ccdb2 100644 --- a/src/main/java/com/ai/da/mapper/primary/entity/CollectionElement.java +++ b/src/main/java/com/ai/da/mapper/primary/entity/CollectionElement.java @@ -75,7 +75,7 @@ public class CollectionElement implements Serializable { */ private String md5; - private String gradientString; +// private String gradientString; /** * 创建时间 diff --git a/src/main/java/com/ai/da/model/dto/CollectionColorDTO.java b/src/main/java/com/ai/da/model/dto/CollectionColorDTO.java index d5581ee9..2820b1a9 100644 --- a/src/main/java/com/ai/da/model/dto/CollectionColorDTO.java +++ b/src/main/java/com/ai/da/model/dto/CollectionColorDTO.java @@ -26,9 +26,9 @@ public class CollectionColorDTO { @ApiModelProperty("潘通RGB值") private String rgbValue; - private Gradient gradient; - - private String gradientString; +// private Gradient gradient; +// +// private String gradientString; private String gradientMinioUrl; diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 9e9d82b0..9c77054c 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -1556,8 +1556,8 @@ public class PythonService { if (SysFileLevel2TypeEnum.SHOES.getRealName().equals(type)) { CollectionColorDTO randomColor = getRandomColor(elementVO.getColorBoards()); pythonItem.setColor(randomColor.getRgbValue()); - pythonItem.setGradient(randomColor.getGradientMinioUrl()); - pythonItem.setGradientString(randomColor.getGradientString()); +// pythonItem.setGradient(randomColor.getGradientMinioUrl()); +// pythonItem.setGradientString(randomColor.getGradientString()); } } } @@ -1922,8 +1922,8 @@ public class PythonService { designPythonItemBlouse.setIcon("none"); CollectionColorDTO randomColor = getRandomColor(elementVO.getColorBoards()); designPythonItemBlouse.setColor(randomColor.getRgbValue()); - designPythonItemBlouse.setGradient(randomColor.getGradientMinioUrl()); - designPythonItemBlouse.setGradientString(randomColor.getGradientString()); +// designPythonItemBlouse.setGradient(randomColor.getGradientMinioUrl()); +// designPythonItemBlouse.setGradientString(randomColor.getGradientString()); if (!elementVO.getDesignPythonItemPrint().getPath().equals("none") && elementVO.getDesignPrintPictureTypeLayoutList().contains(type)) { DesignPythonItemPrint designPythonItemPrint = CopyUtil.copyObject(elementVO.getDesignPythonItemPrint(), DesignPythonItemPrint.class); @@ -1951,8 +1951,8 @@ public class PythonService { designPythonItemBlouse.setIcon("none"); CollectionColorDTO randomColor = getRandomColor(elementVO.getColorBoards()); designPythonItemBlouse.setColor(randomColor.getRgbValue()); - designPythonItemBlouse.setGradient(randomColor.getGradientMinioUrl()); - designPythonItemBlouse.setGradientString(randomColor.getGradientString()); +// designPythonItemBlouse.setGradient(randomColor.getGradientMinioUrl()); +// designPythonItemBlouse.setGradientString(randomColor.getGradientString()); if (!elementVO.getDesignPythonItemPrint().getPath().equals("none") && elementVO.getDesignPrintPictureTypeLayoutList().contains(collectionElement.getLevel2Type())) { DesignPythonItemPrint designPythonItemPrint = CopyUtil.copyObject(elementVO.getDesignPythonItemPrint(), DesignPythonItemPrint.class); 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 3f873a9b..0d91c379 100644 --- a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java @@ -351,20 +351,20 @@ public class CollectionElementServiceImpl extends ServiceImpl colorBoards = elementVO.getColorBoards(); - for (CollectionColorDTO colorBoard : colorBoards) { - if (Objects.nonNull(colorBoard.getGradient())) { - String colorImg = colorBoard.getGradient().getColorImg(); - String[] parts = colorImg.split(","); - String imageType = parts[0].split("/")[1].split(";")[0]; - String base64Data = parts[1]; - String gradientMinioUrl = minioUtil.uploadImageFromBase64(gradientBucketName, base64Data, imageType); - colorBoard.setGradientMinioUrl(gradientMinioUrl); - colorBoard.getGradient().setColorImg(null); - colorBoard.setGradientString(JSON.toJSONString(colorBoard.getGradient())); - } - } - elementVO.setColorBoards(colorBoards); +// List colorBoards = elementVO.getColorBoards(); +// for (CollectionColorDTO colorBoard : colorBoards) { +// if (Objects.nonNull(colorBoard.getGradient())) { +// String colorImg = colorBoard.getGradient().getColorImg(); +// String[] parts = colorImg.split(","); +// String imageType = parts[0].split("/")[1].split(";")[0]; +// String base64Data = parts[1]; +// String gradientMinioUrl = minioUtil.uploadImageFromBase64(gradientBucketName, base64Data, imageType); +// colorBoard.setGradientMinioUrl(gradientMinioUrl); +// colorBoard.getGradient().setColorImg(null); +// colorBoard.setGradientString(JSON.toJSONString(colorBoard.getGradient())); +// } +// } +// elementVO.setColorBoards(colorBoards); List usedElementIds = elementVO.getUsedElementIds(); List libraryCollectionElements = elementVO.getLibraryCollectionElements(); List generateCollectionElements = elementVO.getGenerateCollectionElements(); @@ -783,10 +783,10 @@ public class CollectionElementServiceImpl extends ServiceImpl Date: Tue, 28 May 2024 11:48:35 +0800 Subject: [PATCH 7/9] =?UTF-8?q?BUGFIX:=E6=B8=90=E5=8F=98=E8=89=B2=E5=9B=9E?= =?UTF-8?q?=E9=80=80;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ai/da/python/PythonService.java | 14 ++++++-------- .../com/ai/da/python/vo/DesignPythonItem.java | 10 +++++----- .../da/service/impl/DesignItemServiceImpl.java | 16 ++++++++-------- .../ai/da/service/impl/DesignServiceImpl.java | 2 +- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 9c77054c..0883dd1f 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -2619,16 +2619,16 @@ public class PythonService { } // 判断是否是渐变色 - String minioPath = null; - String gradientString = null; +// String minioPath = null; +// String gradientString = null; if (!Objects.isNull(designSingleItem.getGradient())){ String colorImg = designSingleItem.getGradient().getColorImg(); if (StringUtil.isNullOrEmpty(colorImg)){ throw new BusinessException("The base64 data of the image is empty"); } - minioPath = minioUtil.base64Upload(colorImg, gradientBucketName); - designSingleItem.getGradient().setColorImg(null); - gradientString = JSONObject.toJSONString(designSingleItem.getGradient()); +// minioPath = minioUtil.base64Upload(colorImg, gradientBucketName); +// designSingleItem.getGradient().setColorImg(null); +// gradientString = JSONObject.toJSONString(designSingleItem.getGradient()); // todo 当渐变色不为空时,是否需要将颜色置为 0 0 0 } @@ -2644,9 +2644,7 @@ public class PythonService { pythonTAllInfoService.getImageIdByPath(designSingleItem.getPath()), designSingleItem.getOffset(), designSingleItem.getScale(), - designSingleItem.getPriority(), - minioPath, - gradientString)); + designSingleItem.getPriority())); }); diff --git a/src/main/java/com/ai/da/python/vo/DesignPythonItem.java b/src/main/java/com/ai/da/python/vo/DesignPythonItem.java index 1139c24a..4e72200f 100644 --- a/src/main/java/com/ai/da/python/vo/DesignPythonItem.java +++ b/src/main/java/com/ai/da/python/vo/DesignPythonItem.java @@ -28,9 +28,9 @@ public class DesignPythonItem { */ private String color; - private String gradient; +// private String gradient; - private String gradientString; +// private String gradientString; /** * 对应的print图片的绝对路径 @@ -114,7 +114,7 @@ public class DesignPythonItem { } public DesignPythonItem(String type, String path, String color, DesignPythonItemPrint print, Long businessId, - Long image_id, List offset, Float[] resize_scale, Integer priority, String gradient, String gradientString) { + Long image_id, List offset, Float[] resize_scale, Integer priority) { this.type = type; this.path = path; this.color = color; @@ -125,8 +125,8 @@ public class DesignPythonItem { this.offset = offset; this.resize_scale = resize_scale; this.priority = priority; - this.gradient = gradient; - this.gradientString = gradientString; +// this.gradient = gradient; +// this.gradientString = gradientString; } public DesignPythonItem(String type, String path, String color, DesignPythonItemPrint print, String icon, Long businessId, Long image_id) { diff --git a/src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java b/src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java index afb5d07e..f5724800 100644 --- a/src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java @@ -417,14 +417,14 @@ public class DesignItemServiceImpl extends ServiceImpl { - if (!Objects.isNull(i.getGradient()) && !StringUtil.isNullOrEmpty(i.getGradient().getColorImg())){ - i.getGradient().setColorImg(null); - } - }); +// DesignSingleIncludeLayersDTO clone = SerializationUtils.clone(designSingleIncludeLayersDTO); +// clone.getDesignSingleItemDTOList().forEach( i -> { +// if (!Objects.isNull(i.getGradient()) && !StringUtil.isNullOrEmpty(i.getGradient().getColorImg())){ +// i.getGradient().setColorImg(null); +// } +// }); - log.info("designSingle request入参 ==> " + JSONObject.toJSONString(clone)); +// log.info("designSingle request入参 ==> " + JSONObject.toJSONString(clone)); Long userId = UserContext.getUserHolder().getId(); DesignItem designItem = selectById(designSingleIncludeLayersDTO.getDesignItemId()); @@ -649,7 +649,7 @@ public class DesignItemServiceImpl extends ServiceImpl (singleItem.getType().toLowerCase().equals(layers.getImageCategory().split("_")[0]) && (flag ? Boolean.TRUE : singleItem.getPriority().equals(layers.getPriority()))) ).collect(Collectors.toList())); - designItemClothesDetailVO.setGradient(singleItem.getGradient()); +// designItemClothesDetailVO.setGradient(singleItem.getGradient()); body.setLayersObject(layersObject.stream().filter(layers -> layers.getImageCategory().equals("body")).collect(Collectors.toList())); clothes.add(designItemClothesDetailVO); 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 3ac8fe25..d3b961c4 100644 --- a/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java @@ -998,7 +998,7 @@ public class DesignServiceImpl extends ServiceImpl impleme d.setPath(minioUtil.getPresignedUrl(o.getPath(), 24 * 60)); d.setMinIOPath(o.getPath()); d.setLevel1Type(converTypeToLevel1(o.getType())); - d.setGradient(JSONObject.parseObject(o.getGradientString(), Gradient.class)); +// d.setGradient(JSONObject.parseObject(o.getGradientString(), Gradient.class)); // 根据designItemDetailId获取印花 List prints = designItemDetailPrintService.getByDesignItemDetailId(o.getId()); // 判断有无印花 From 3dc7866fba546d4b6d4e1bcab504022bae50c4d6 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Tue, 28 May 2024 11:52:33 +0800 Subject: [PATCH 8/9] =?UTF-8?q?BUGFIX:=E6=B8=90=E5=8F=98=E8=89=B2=E5=9B=9E?= =?UTF-8?q?=E9=80=80;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../primary/entity/DesignItemDetail.java | 2 +- .../ai/da/model/dto/CollectionColorDTO.java | 2 +- .../ai/da/model/dto/DesignSingleItemDTO.java | 4 ++-- .../java/com/ai/da/python/PythonService.java | 22 +++++++++---------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/ai/da/mapper/primary/entity/DesignItemDetail.java b/src/main/java/com/ai/da/mapper/primary/entity/DesignItemDetail.java index 969c306b..bfba71d1 100644 --- a/src/main/java/com/ai/da/mapper/primary/entity/DesignItemDetail.java +++ b/src/main/java/com/ai/da/mapper/primary/entity/DesignItemDetail.java @@ -64,7 +64,7 @@ public class DesignItemDetail implements Serializable { */ private String color; - private String gradientString; +// private String gradientString; /** * 对应的print图片的绝对路径 diff --git a/src/main/java/com/ai/da/model/dto/CollectionColorDTO.java b/src/main/java/com/ai/da/model/dto/CollectionColorDTO.java index 2820b1a9..72e59a93 100644 --- a/src/main/java/com/ai/da/model/dto/CollectionColorDTO.java +++ b/src/main/java/com/ai/da/model/dto/CollectionColorDTO.java @@ -30,6 +30,6 @@ public class CollectionColorDTO { // // private String gradientString; - private String gradientMinioUrl; +// private String gradientMinioUrl; } diff --git a/src/main/java/com/ai/da/model/dto/DesignSingleItemDTO.java b/src/main/java/com/ai/da/model/dto/DesignSingleItemDTO.java index 0716bf86..e9f051bc 100644 --- a/src/main/java/com/ai/da/model/dto/DesignSingleItemDTO.java +++ b/src/main/java/com/ai/da/model/dto/DesignSingleItemDTO.java @@ -50,7 +50,7 @@ public class DesignSingleItemDTO implements Serializable { @ApiModelProperty("图层优先级") private Integer priority; - @ApiModelProperty("渐变 颜色") - private Gradient gradient; +// @ApiModelProperty("渐变 颜色") +// private Gradient gradient; } diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 0883dd1f..e356357a 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -2621,17 +2621,17 @@ public class PythonService { // 判断是否是渐变色 // String minioPath = null; // String gradientString = null; - if (!Objects.isNull(designSingleItem.getGradient())){ - String colorImg = designSingleItem.getGradient().getColorImg(); - if (StringUtil.isNullOrEmpty(colorImg)){ - throw new BusinessException("The base64 data of the image is empty"); - } -// minioPath = minioUtil.base64Upload(colorImg, gradientBucketName); -// designSingleItem.getGradient().setColorImg(null); -// gradientString = JSONObject.toJSONString(designSingleItem.getGradient()); - - // todo 当渐变色不为空时,是否需要将颜色置为 0 0 0 - } +// if (!Objects.isNull(designSingleItem.getGradient())){ +// String colorImg = designSingleItem.getGradient().getColorImg(); +// if (StringUtil.isNullOrEmpty(colorImg)){ +// throw new BusinessException("The base64 data of the image is empty"); +// } +//// minioPath = minioUtil.base64Upload(colorImg, gradientBucketName); +//// designSingleItem.getGradient().setColorImg(null); +//// gradientString = JSONObject.toJSONString(designSingleItem.getGradient()); +// +// // todo 当渐变色不为空时,是否需要将颜色置为 0 0 0 +// } response.add(new DesignPythonItem( designSingleItem.getType(), From 775ae3266c1cf4634a20bca58a354ea1e8562ede Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Fri, 31 May 2024 09:59:08 +0800 Subject: [PATCH 9/9] =?UTF-8?q?BUGFIX:=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=BC=80=E5=90=AF;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ai/da/common/config/MyTaskScheduler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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 bd8f2687..6e443ba9 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -34,7 +34,7 @@ public class MyTaskScheduler { // 定时任务,每十五天执行一次 // @Scheduled(cron = "0 0 0 ? * MON") -// @Scheduled(cron = "0 0 0 */15 * ?") + @Scheduled(cron = "0 0 0 */15 * ?") public void checkExpiry() { // 检测正式用户是否快要过期 QueryWrapper qw = new QueryWrapper<>(); @@ -68,7 +68,7 @@ public class MyTaskScheduler { } } } -// @Scheduled(cron = "0 0 8 * * ?") + @Scheduled(cron = "0 0 8 * * ?") public void sendTrialOrderExcelToManagements() { // 获取前一天日期 LocalDate yesterday = LocalDate.now().minusDays(1);