From 43968995ea733f343fd1a683aee55f014a922616 Mon Sep 17 00:00:00 2001 From: xupei Date: Thu, 19 Dec 2024 17:37:28 +0800 Subject: [PATCH 1/8] =?UTF-8?q?generate=E5=8E=BB=E9=99=A4=E9=A2=9D?= =?UTF-8?q?=E5=A4=96prompt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ai/da/service/impl/GenerateServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java index e8c7aa39..ec5d5774 100644 --- a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java @@ -328,7 +328,8 @@ public class GenerateServiceImpl extends ServiceImpl i // generate.setText(text); break; case "Printboard": - if (prefix.contains("Painting Style")) { + text = translated; + /*if (prefix.contains("Painting Style")) { text = "Picasso,increased color saturation,increased glossiness," + translated + ", fabric print, high quality"; } else if (prefix.contains("Illustration Style")) { text = "Flat coating,romantic,soft,pencil strokes,accentuating and widening the depth of pencil strokes,paper patterns,block colors,crayons,reducing image contrast,and hand drawn painting marks," + translated + ", fabric print, high quality"; @@ -336,7 +337,7 @@ public class GenerateServiceImpl extends ServiceImpl i text = "Hyper realism,3d,deepened projection,increased permutation value,increased concavity and convexity value," + translated + ", fabric print, high quality"; } else { text = translated; - } + }*/ // text = userInput + ", fabric print, high quality"; // generate.setText(text); break; From afeeef4af75fbf71a2771fbae43c0638560d3e18 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Sat, 4 Jan 2025 21:35:21 +0800 Subject: [PATCH 2/8] =?UTF-8?q?TASK:=E8=AF=95=E7=94=A8=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=8E=A5=E6=94=B6=E5=90=8D=E5=8D=95=E6=B7=BB=E5=8A=A0;?= 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 | 6 ++++++ .../java/com/ai/da/service/impl/AccountServiceImpl.java | 1 + 2 files changed, 7 insertions(+) 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 95c55e9a..7eb5d0d2 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -140,6 +140,9 @@ public class MyTaskScheduler { SendEmailUtil.sendExcelEmail("calvinwong@aidlab.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName); SendEmailUtil.sendExcelEmail("kaicpang.pang@connect.polyu.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName); SendEmailUtil.sendExcelEmail("kimwong@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName); + SendEmailUtil.sendExcelEmail("ningning@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName); + SendEmailUtil.sendExcelEmail("johnnyho@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName); + SendEmailUtil.sendExcelEmail("ringolau@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName); } } catch (IOException e) { e.printStackTrace(); @@ -149,6 +152,9 @@ public class MyTaskScheduler { SendEmailUtil.sendNoExcelEmail("calvinwong@aidlab.hk", null); SendEmailUtil.sendNoExcelEmail("kaicpang.pang@connect.polyu.hk", null); SendEmailUtil.sendNoExcelEmail("kimwong@code-create.com.hk", null); + SendEmailUtil.sendNoExcelEmail("ningning@code-create.com.hk", null); + SendEmailUtil.sendNoExcelEmail("johnnyho@code-create.com.hk", null); + SendEmailUtil.sendNoExcelEmail("ringolau@code-create.com.hk", null); } } 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 3baf594a..09029be7 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -807,6 +807,7 @@ public class AccountServiceImpl extends ServiceImpl impl throw new BusinessException("Machine not registered or machine identification has changed, login free has failed, please contact us at help@aida.com.hk."); } Account account = accountList.get(0); + validateUserValidaExpire(account); AccountLoginVO response = CopyUtil.copyObject(account, AccountLoginVO.class); String token = LocalCacheUtils.getTokenCache(String.valueOf(account.getId())); if (StringUtils.isNotBlank(token)) { From d04987a3e2116784e9517914344050352a5443db Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Tue, 7 Jan 2025 09:58:36 +0800 Subject: [PATCH 3/8] BUGFIX:moodboard edit; --- src/main/java/com/ai/da/service/impl/DesignServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java b/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java index 9aa89340..2c2d9c41 100644 --- a/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java @@ -399,7 +399,7 @@ public class DesignServiceImpl extends ServiceImpl impleme if (!reDesignDTO.getMoodboardPosition().equals(collection.getMoodboardPosition())) { collection.setMoodboardPosition(reDesignDTO.getMoodboardPosition()); } - if (null != reDesignDTO.getMoodTemplateId() && reDesignDTO.getMoodTemplateId().equals(collection.getMoodTemplateId())) { + if (null != reDesignDTO.getMoodTemplateId() && !reDesignDTO.getMoodTemplateId().equals(collection.getMoodTemplateId())) { collection.setMoodTemplateId(reDesignDTO.getMoodTemplateId()); } collectionService.updateById(collection); From 367fa130c0fd5bf8fb70fc96ab97b9f38c131611 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Tue, 7 Jan 2025 10:58:57 +0800 Subject: [PATCH 4/8] BUGFIX:moodboard edit; --- src/main/java/com/ai/da/model/dto/DesignCollectionDTO.java | 2 +- .../java/com/ai/da/service/impl/CollectionServiceImpl.java | 4 ++-- src/main/java/com/ai/da/service/impl/DesignServiceImpl.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/ai/da/model/dto/DesignCollectionDTO.java b/src/main/java/com/ai/da/model/dto/DesignCollectionDTO.java index 478483c4..cad8e572 100644 --- a/src/main/java/com/ai/da/model/dto/DesignCollectionDTO.java +++ b/src/main/java/com/ai/da/model/dto/DesignCollectionDTO.java @@ -61,6 +61,6 @@ public class DesignCollectionDTO { @ApiModelProperty("python端design进程ID") private String processId; - private String moodboardPostion; + private String moodboardPosition; } diff --git a/src/main/java/com/ai/da/service/impl/CollectionServiceImpl.java b/src/main/java/com/ai/da/service/impl/CollectionServiceImpl.java index 218c9814..87495e7f 100644 --- a/src/main/java/com/ai/da/service/impl/CollectionServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/CollectionServiceImpl.java @@ -48,12 +48,12 @@ public class CollectionServiceImpl extends ServiceImpl impleme //保存collection Long collectionId; if (null == collectionIdParam) { - collectionId = collectionService.saveCollection(userInfo.getId(), designDTO.getTimeZone(), designDTO.getMoodTemplateId(), designDTO.getMoodboardPostion()); + collectionId = collectionService.saveCollection(userInfo.getId(), designDTO.getTimeZone(), designDTO.getMoodTemplateId(), designDTO.getMoodboardPosition()); }else { collectionId = collectionIdParam; // Collection byId = collectionService.getById(collectionIdParam); From 30312caf829acc06606aa4311d828ef4feb13beb Mon Sep 17 00:00:00 2001 From: xupei Date: Tue, 7 Jan 2025 17:27:29 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E8=AE=BF=E9=97=AE=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ai/da/controller/ConvenientInquiryController.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ai/da/controller/ConvenientInquiryController.java b/src/main/java/com/ai/da/controller/ConvenientInquiryController.java index ecc8fdd1..c1158fe6 100644 --- a/src/main/java/com/ai/da/controller/ConvenientInquiryController.java +++ b/src/main/java/com/ai/da/controller/ConvenientInquiryController.java @@ -11,9 +11,11 @@ import com.ai.da.model.dto.UserDesignStatisticDTO; import com.ai.da.model.vo.QuestionnaireFeedbackVO; import com.ai.da.model.vo.QuestionnaireVO; import com.ai.da.model.vo.QueryUserConditionsVO; +import com.ai.da.service.AccountService; import com.ai.da.service.ConvenientInquiryService; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.itextpdf.text.pdf.PRIndirectReference; import io.netty.util.internal.StringUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -36,13 +38,19 @@ public class ConvenientInquiryController { private DesignMapper designMapper; @Resource private ConvenientInquiryService convenientInquiryService; + @Resource + private AccountService accountService; @ApiOperation("获取当前所有试用用户") @PostMapping("/getTrial") public Response> getTrial(@Valid @RequestBody QueryUserConditionsVO queryUserConditionsVO) { Long accountId = UserContext.getUserHolder().getId(); - if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L) || accountId.equals(6L) || accountId.equals(4L) || accountId.equals(73L)) { + String userEmail = accountService.getById(accountId).getUserEmail(); + if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L) + || accountId.equals(6L) || accountId.equals(4L) || accountId.equals(73L) + || userEmail.equals("joho8228@hotmail.com") || userEmail.equals("wanninghua160@gmail.com") + ) { return Response.success(convenientInquiryService.getTrial(queryUserConditionsVO)); } else { return Response.fail("Sorry, you don't have permission"); From f6b489d950dc687529ea4280b9e3a8dee0a90b60 Mon Sep 17 00:00:00 2001 From: xupei Date: Wed, 8 Jan 2025 09:50:13 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E9=A1=B5=E9=9D=A2=E8=AE=BF=E9=97=AE=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ConvenientInquiryController.java | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/ai/da/controller/ConvenientInquiryController.java b/src/main/java/com/ai/da/controller/ConvenientInquiryController.java index c1158fe6..3d74c777 100644 --- a/src/main/java/com/ai/da/controller/ConvenientInquiryController.java +++ b/src/main/java/com/ai/da/controller/ConvenientInquiryController.java @@ -62,7 +62,11 @@ public class ConvenientInquiryController { public Response> getDesignStatistic(@RequestParam String startTime, @RequestParam String endTime, @RequestParam(required = false) List ids, @RequestParam(required = false) String email) { Long accountId = UserContext.getUserHolder().getId(); - if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L) || accountId.equals(6L) || accountId.equals(4L) || accountId.equals(73L)) { + String userEmail = accountService.getById(accountId).getUserEmail(); + if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L) + || accountId.equals(6L) || accountId.equals(4L) || accountId.equals(73L) + || userEmail.equals("joho8228@hotmail.com") || userEmail.equals("wanninghua160@gmail.com") + ) { if (StringUtil.isNullOrEmpty(startTime)) startTime = "2024-02-01 00:00:00"; if (StringUtil.isNullOrEmpty(endTime)) { SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); @@ -145,7 +149,14 @@ public class ConvenientInquiryController { @ApiOperation("添加用户") @PostMapping("/addUser") public Response addUser(@Valid @RequestBody AccountAddDTO accountAddDTO) { - return Response.success(convenientInquiryService.addUser(accountAddDTO)); + Long userAccountId = UserContext.getUserHolder().getId(); + if (userAccountId.equals(31L) || userAccountId.equals(87L) + || userAccountId.equals(6L) || userAccountId.equals(4L) || userAccountId.equals(73L) + ) { + return Response.success(convenientInquiryService.addUser(accountAddDTO)); + } else { + return Response.fail("Sorry, you don't have permission"); + } } @ApiOperation("修改用户信息") @@ -154,14 +165,25 @@ public class ConvenientInquiryController { @ApiParam(value = "有效期截止时间的毫秒级unix格式") @RequestParam @Nullable Long validEndTime, @ApiParam(value = "用户类型 1/2/3/0 -> yearly/monthly/trial/visitor") @RequestParam @Nullable Integer systemUser, @ApiParam("积分") @RequestParam @Nullable Long credits) { - return Response.success(convenientInquiryService.modifyUser(accountId, validEndTime, systemUser, credits)); + Long userAccountId = UserContext.getUserHolder().getId(); + if (userAccountId.equals(31L) || userAccountId.equals(87L) + || userAccountId.equals(6L) || userAccountId.equals(4L) || userAccountId.equals(73L) + ) { + return Response.success(convenientInquiryService.modifyUser(accountId, validEndTime, systemUser, credits)); + } else { + return Response.fail("Sorry, you don't have permission"); + } } @ApiOperation("获取用户信息") @PostMapping("/getUserInfo") public Response> getUserInfo(@Valid @RequestBody QueryUserConditionsVO queryUserConditionsVO) { Long accountId = UserContext.getUserHolder().getId(); - if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L) || accountId.equals(6L) || accountId.equals(4L) || accountId.equals(73L)) { + String userEmail = accountService.getById(accountId).getUserEmail(); + if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L) + || accountId.equals(6L) || accountId.equals(4L) || accountId.equals(73L) + || userEmail.equals("joho8228@hotmail.com") || userEmail.equals("wanninghua160@gmail.com") + ) { return Response.success(convenientInquiryService.getUserInfo(queryUserConditionsVO)); } else { return Response.fail("Sorry, you don't have permission"); From 66158e94dde6c398cb78af78737e76da6eaf2ccd Mon Sep 17 00:00:00 2001 From: xupei Date: Wed, 8 Jan 2025 10:12:43 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E9=99=90=E5=88=B6=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ai/da/service/impl/ConvenientInquiryServiceImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 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 819dc95d..69167b80 100644 --- a/src/main/java/com/ai/da/service/impl/ConvenientInquiryServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/ConvenientInquiryServiceImpl.java @@ -502,7 +502,7 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl Date: Wed, 8 Jan 2025 10:24:51 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E9=99=90=E5=88=B6=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/controller/ConvenientInquiryController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ai/da/controller/ConvenientInquiryController.java b/src/main/java/com/ai/da/controller/ConvenientInquiryController.java index 3d74c777..9795ca1a 100644 --- a/src/main/java/com/ai/da/controller/ConvenientInquiryController.java +++ b/src/main/java/com/ai/da/controller/ConvenientInquiryController.java @@ -150,7 +150,7 @@ public class ConvenientInquiryController { @PostMapping("/addUser") public Response addUser(@Valid @RequestBody AccountAddDTO accountAddDTO) { Long userAccountId = UserContext.getUserHolder().getId(); - if (userAccountId.equals(31L) || userAccountId.equals(87L) + if (userAccountId.equals(31L) || userAccountId.equals(87L) || userAccountId.equals(83L) || userAccountId.equals(6L) || userAccountId.equals(4L) || userAccountId.equals(73L) ) { return Response.success(convenientInquiryService.addUser(accountAddDTO)); @@ -166,7 +166,7 @@ public class ConvenientInquiryController { @ApiParam(value = "用户类型 1/2/3/0 -> yearly/monthly/trial/visitor") @RequestParam @Nullable Integer systemUser, @ApiParam("积分") @RequestParam @Nullable Long credits) { Long userAccountId = UserContext.getUserHolder().getId(); - if (userAccountId.equals(31L) || userAccountId.equals(87L) + if (userAccountId.equals(31L) || userAccountId.equals(87L) || userAccountId.equals(83L) || userAccountId.equals(6L) || userAccountId.equals(4L) || userAccountId.equals(73L) ) { return Response.success(convenientInquiryService.modifyUser(accountId, validEndTime, systemUser, credits));