From 6fa6c38398c2cbe19c332d8671487100ff1aed29 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Thu, 11 Jul 2024 10:50:24 +0800 Subject: [PATCH 1/5] =?UTF-8?q?BUGFIX:=E8=AF=95=E7=94=A8=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../da/service/impl/AccountServiceImpl.java | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 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 c6376ee0..2dc061d0 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -559,7 +559,8 @@ public class AccountServiceImpl extends ServiceImpl impl account.setCreateDate(new Date()); account.setIsTrial(1); account.setIsBeginner(1); - account.setSystemUser(1); + account.setSystemUser(3); + account.setCredits(BigDecimal.valueOf(100)); accountMapper.insert(account); } // 发送邮件提醒用户试用用户已创建 @@ -927,24 +928,31 @@ public class AccountServiceImpl extends ServiceImpl impl @Override public void upgradeNotification() { +// QueryWrapper queryWrapper = new QueryWrapper<>(); +//// queryWrapper.eq("id", 88L); +// queryWrapper.and(wrapper -> +// wrapper.gt("valid_end_time", 1720540799000L) +// .or().isNull("valid_end_time")) +// .isNotNull("user_email"); + QueryWrapper queryWrapper = new QueryWrapper<>(); -// queryWrapper.eq("id", 88L); - queryWrapper.and(wrapper -> - wrapper.gt("valid_end_time", 1720540799000L) - .or().isNull("valid_end_time")) - .isNotNull("user_email"); + queryWrapper.lt("valid_end_time", 1720540799000L); List accountList = accountMapper.selectList(queryWrapper); System.out.println(accountList); + int i = 0; for (Account account : accountList) { // SendEmailUtil.sendUpgradeNotification(account, null, 0); // SendEmailUtil.sendUpgradeNotification(account, null, 1); - if (account.getLanguage().equals(Language.CHINESE_SIMPLIFIED.name())) { - SendEmailUtil.sendUpgradeNotification(account, null, 0); - } else { - // 英文 - SendEmailUtil.sendUpgradeNotification(account, null, 1); + if (i > 6) { + if (account.getLanguage().equals(Language.CHINESE_SIMPLIFIED.name())) { + SendEmailUtil.sendUpgradeNotification(account, null, 0); + } else { + // 英文 + SendEmailUtil.sendUpgradeNotification(account, null, 1); + } } + i ++; } } From 679b213b6ff56be6f0a827a6744485685bde875a Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Thu, 11 Jul 2024 15:54:08 +0800 Subject: [PATCH 2/5] BUGFIX:aida --- src/main/java/com/ai/da/python/PythonService.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 266f3dee..3dd32bb3 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -716,6 +716,17 @@ public class PythonService { if (CollectionUtil.isEmpty(attributeRetrievalList)) { System.out.println(attributeRetrievalAttrDict); System.out.println(tableName); + if (!StringUtils.isEmpty(style)) { + attributeRetrievalAttrDict.setType(null); + attributeRetrievalAttrDict.setOpeningType(null); + attributeRetrievalAttrDict.setSubtype(null); + attributeRetrievalList = attributeRetrievalMapper.getSystemSketchPoolBySameCategory(attributeRetrievalAttrDict, tableName, style); + }else { + attributeRetrievalAttrDict.setType(null); + attributeRetrievalAttrDict.setOpeningType(null); + attributeRetrievalAttrDict.setSubtype(null); + attributeRetrievalList = attributeRetrievalMapper.getSystemSketchPoolBySameCategory(attributeRetrievalAttrDict, tableName, style); + } } return toColoectionElementList(attributeRetrievalList, styleCategory, modelSex); } From 6a098ffa13078666d434657cdf15ca6698e67e37 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Sat, 13 Jul 2024 12:40:13 +0800 Subject: [PATCH 3/5] =?UTF-8?q?BUGFIX:=E5=8F=91=E9=80=81=E6=AF=8F=E6=97=A5?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E8=AF=95=E7=94=A8=E7=94=A8=E6=88=B7=E9=82=AE?= =?UTF-8?q?=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 d04ec9fe..69f2ffd9 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -86,7 +86,7 @@ public class MyTaskScheduler { @Scheduled(cron = "0 0 8 * * ?") public void sendTrialOrderExcelToManagements() { // 获取前一天日期 - LocalDate yesterday = LocalDate.now().minusDays(3); + LocalDate yesterday = LocalDate.now().minusDays(1); // 查询前一天的试用订单 QueryWrapper qw = new QueryWrapper<>(); From f77de3a1f47e374156f8b8cf7ca9ef02ea8c9f30 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Mon, 15 Jul 2024 13:43:44 +0800 Subject: [PATCH 4/5] BUGFIX:token filter --- .../ai/da/common/security/filter/AuthenticationFilter.java | 7 ++++++- 1 file changed, 6 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 0d1bed1a..47c94026 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 @@ -57,7 +57,7 @@ public class AuthenticationFilter extends OncePerRequestFilter { protected void doFilterInternal(HttpServletRequest httpServletRequest, @NonNull HttpServletResponse httpServletResponse, @NonNull FilterChain filterChain) throws ServletException, IOException { String requestURI = httpServletRequest.getRequestURI(); - if (calculateUrl(requestURI)) { + if (calculateUrl(requestURI) || hasAuthorizationToken(httpServletRequest)) { StopWatch stopWatch = new StopWatch(); HttpServletRequest wrappedRequest = httpServletRequest; HttpServletResponse wrappedResponse = httpServletResponse; @@ -88,6 +88,11 @@ public class AuthenticationFilter extends OncePerRequestFilter { return null == filterUrl ? Boolean.TRUE : Boolean.FALSE; } + private boolean hasAuthorizationToken(HttpServletRequest request) { + String authorizationHeader = request.getHeader("Authorization"); + return authorizationHeader != null && authorizationHeader.startsWith("Bearer"); + } + private void extracted(HttpServletRequest request) throws AuthenticationException { String jwtToken = request.getHeader(properties.getJwtTokenHeader()); // log.debug("后台检查令牌:{}", jwtToken); From 9b185e691943f312c552b3883773c0d4db87fc98 Mon Sep 17 00:00:00 2001 From: xupei Date: Mon, 15 Jul 2024 13:47:43 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=B8=B8=E5=AE=A2=E5=88=B0=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E7=94=A8=E6=88=B7=E8=BA=AB=E4=BB=BD=E8=BD=AC=E6=8D=A2?= 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 2dc061d0..b3ded85a 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -508,7 +508,7 @@ public class AccountServiceImpl extends ServiceImpl impl QueryWrapper qw = new QueryWrapper<>(); qw.eq("BINARY user_email", accountTrialDTO.getEmail()); List accountList = accountMapper.selectList(qw); - if (CollectionUtil.isNotEmpty(accountList)) { + if (CollectionUtil.isNotEmpty(accountList) && !accountList.get(0).getSystemUser().equals(0)) { if (accountList.get(0).getIsTrial() == 1) { throw new BusinessException("The email has already been registered", ResultEnum.PROMPT.getCode()); } else { @@ -538,6 +538,7 @@ public class AccountServiceImpl extends ServiceImpl impl account = CopyUtil.copyObject(accountList.get(0), Account.class); account.setIsTrial(1); account.setIsBeginner(1); + account.setSystemUser(3); account.setValidStartTime(System.currentTimeMillis()); if (link) { account.setValidEndTime(Instant.now().plus(14, ChronoUnit.DAYS).toEpochMilli());