diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index e69de29b..00000000 diff --git a/pom.xml b/pom.xml index 966478f8..e2a8d0f6 100644 --- a/pom.xml +++ b/pom.xml @@ -202,6 +202,13 @@ 20230618 + + org.apache.logging.log4j + log4j-api + 2.17.1 + + + org.apache.poi poi 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/security/filter/AuthenticationFilter.java b/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java index 4256b8fe..24f96520 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 @@ -89,7 +89,7 @@ public class AuthenticationFilter extends OncePerRequestFilter { private void extracted(HttpServletRequest request) throws AuthenticationException { String jwtToken = request.getHeader(properties.getJwtTokenHeader()); - log.debug("后台检查令牌:{}", jwtToken); +// log.debug("后台检查令牌:{}", jwtToken); if (StrUtil.isBlank(jwtToken)) { String ipAddress = RequestInfoUtil.getIpAddress(request); 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 7b5462dd..73c4eb17 100644 --- a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java +++ b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java @@ -135,6 +135,7 @@ public class SendEmailUtil { private final static Long NOTIFICATION_CHINESE_TEMPLATE_ID = 122229L; 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) { try { // 实例化一个认证对象 @@ -229,6 +230,7 @@ public class SendEmailUtil { } } + public static void sendNoExcelEmail(String receiverAddress, String senderAddress) { try { // 实例化一个认证对象 diff --git a/src/main/java/com/ai/da/controller/WorkspaceController.java b/src/main/java/com/ai/da/controller/WorkspaceController.java index b0c089f0..d44abf2e 100644 --- a/src/main/java/com/ai/da/controller/WorkspaceController.java +++ b/src/main/java/com/ai/da/controller/WorkspaceController.java @@ -44,8 +44,8 @@ public class WorkspaceController { @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入workspace") - public Response detail(@ApiParam(value = "主键集合", required = true) @RequestParam Long id) { - Workspace detail = workspaceService.getByIdNew(id); + public Response detail(@ApiParam(value = "主键集合", required = true) @RequestParam Long id) { + WorkspaceVO detail = workspaceService.getByIdNew(id); return Response.success(detail); } diff --git a/src/main/java/com/ai/da/model/vo/CollectionColorVO.java b/src/main/java/com/ai/da/model/vo/CollectionColorVO.java index 057cca64..475e159a 100644 --- a/src/main/java/com/ai/da/model/vo/CollectionColorVO.java +++ b/src/main/java/com/ai/da/model/vo/CollectionColorVO.java @@ -3,10 +3,12 @@ package com.ai.da.model.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import lombok.EqualsAndHashCode; import javax.validation.constraints.NotBlank; @Data +@EqualsAndHashCode @ApiModel("设计Collection颜色板 响应") public class CollectionColorVO { diff --git a/src/main/java/com/ai/da/model/vo/UserLikeCollectionVO.java b/src/main/java/com/ai/da/model/vo/UserLikeCollectionVO.java index 4e5f5721..ac87037f 100644 --- a/src/main/java/com/ai/da/model/vo/UserLikeCollectionVO.java +++ b/src/main/java/com/ai/da/model/vo/UserLikeCollectionVO.java @@ -3,10 +3,12 @@ package com.ai.da.model.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import lombok.EqualsAndHashCode; import java.util.List; @Data +@EqualsAndHashCode @ApiModel("用户关联的collection-响应") public class UserLikeCollectionVO { diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 7b831e23..9e9d82b0 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -679,7 +679,7 @@ public class PythonService { } if (attributeRetrievalAttrDict.getOpeningType() != null) { nonNullFields.add("openingType"); - if (tableName.equals("male_outwear")) { + if (tableName.equals("male_outwear") || tableName.equals("male_top") || tableName.equals("male_bottom")) { nonNullFields.remove("openingType"); attributeRetrievalAttrDict.setOpeningType(null); } @@ -965,7 +965,7 @@ public class PythonService { QueryWrapper qw = new QueryWrapper<>(); qw.lambda().eq(Dressing::getApparel, validateElementVO.getModelSex()); if (validateElementVO.getSingleOverall().equals(SingleOverallEnum.SINGLE.getRealName())) { - qw.lambda().eq(Dressing::getApparel, validateElementVO.getSwitchCategory()); + qw.lambda().eq(Dressing::getStyleCategory, validateElementVO.getSwitchCategory()); } List dressings = dressingMapper.selectList(qw); if (CollectionUtil.isEmpty(dressings)) { diff --git a/src/main/java/com/ai/da/service/WorkspaceService.java b/src/main/java/com/ai/da/service/WorkspaceService.java index 17a66f29..a60395ca 100644 --- a/src/main/java/com/ai/da/service/WorkspaceService.java +++ b/src/main/java/com/ai/da/service/WorkspaceService.java @@ -35,7 +35,7 @@ public interface WorkspaceService extends IService { List getEnumValues(String enumName); - Workspace getByIdNew(Long id); + WorkspaceVO getByIdNew(Long id); List getMannequins(String sex); 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 77f44f4f..57300f41 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -482,7 +482,7 @@ public class AccountServiceImpl extends ServiceImpl impl } // 先检测用户名和邮箱 QueryWrapper qw = new QueryWrapper<>(); - qw.eq("BINARY email", accountTrialDTO.getEmail()); + qw.eq("BINARY user_email", accountTrialDTO.getEmail()); List accountList = accountMapper.selectList(qw); if (CollectionUtil.isNotEmpty(accountList)) { if (accountList.get(0).getIsTrial() == 1) { @@ -533,7 +533,11 @@ public class AccountServiceImpl extends ServiceImpl impl // SendEmailUtil.sendCustomEmail("1023316923@qq.com", null, trialOrder,2); // SendEmailUtil.sendCustomEmail("calvinwong@aidlab.hk", null, trialOrder,2); // SendEmailUtil.sendCustomEmail("kaicpang.pang@connect.polyu.hk", null, trialOrder,2); - SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry()); + if (trialOrder.getCountry().equals("China")) { + SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry()); + }else { + SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry()); + } } return Boolean.TRUE; } @@ -554,7 +558,7 @@ public class AccountServiceImpl extends ServiceImpl impl trialOrderMapper.updateById(trialOrder); QueryWrapper qw = new QueryWrapper<>(); - qw.eq("BINARY email", trialOrder.getEmail()); + qw.eq("BINARY user_email", trialOrder.getEmail()); List accountList = accountMapper.selectList(qw); Account account = new Account(); @@ -578,10 +582,14 @@ public class AccountServiceImpl extends ServiceImpl impl accountMapper.insert(account); } // 发送邮件提醒用户试用用户已创建 -// SendEmailUtil.sendCustomEmail("1023316923@qq.com", null, trialOrder,2); -// SendEmailUtil.sendCustomEmail("calvinwong@aidlab.hk", null, trialOrder,2); -// SendEmailUtil.sendCustomEmail("kaicpang.pang@connect.polyu.hk", null, trialOrder,2); - SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry()); +// SendEmailUtil.sendCustomEmail("1023316923@qq.com", null, trialOrder,2, trialOrder.getCountry()); +// 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()); + }else { + SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry()); + } } return Boolean.TRUE; } 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 0a6bfb8c..5b85f7fc 100644 --- a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java @@ -190,11 +190,11 @@ public class CollectionElementServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.in("id", ids); - CollectionElement collectionElement = new CollectionElement(); - collectionElement.setCollectionId(0L); - collectionElementMapper.update(collectionElement, queryWrapper); +// QueryWrapper queryWrapper = new QueryWrapper<>(); +// queryWrapper.in("id", ids); +// CollectionElement collectionElement = new CollectionElement(); +// collectionElement.setCollectionId(0L); + collectionElementMapper.deleteBatchIds(ids); } @Override 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 6b911d49..6cd25d76 100644 --- a/src/main/java/com/ai/da/service/impl/CollectionServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/CollectionServiceImpl.java @@ -1,5 +1,6 @@ package com.ai.da.service.impl; +import cn.hutool.core.collection.CollectionUtil; import com.ai.da.common.config.exception.BusinessException; import com.ai.da.common.enums.CollectionLevel1TypeEnum; import com.ai.da.common.enums.DesignTypeEnum; @@ -129,6 +130,12 @@ public class CollectionServiceImpl extends ServiceImpl collect = response.getColorBoards().stream() + .distinct() + .collect(Collectors.toList()); + response.setColorBoards(collect); + } return response; } 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 20142a05..97a0553f 100644 --- a/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java @@ -300,7 +300,7 @@ public class DesignServiceImpl extends ServiceImpl impleme //generate转化为collection(生成) saveCollectionElemntsByGenerates(elementVO, collectionId); //保存颜色版 - List colorElementList = collectionElementService.saveColorBoard(designDTO.getColorBoards(), collectionId, designDTO.getTimeZone()); + collectionElementService.saveColorBoard(designDTO.getColorBoards(), collectionId, designDTO.getTimeZone()); //保存design Long designId = saveOne(designDTO, collectionId, userInfo.getId()); //计算library @@ -725,8 +725,10 @@ public class DesignServiceImpl extends ServiceImpl impleme DesignCollectionDTO designCollectionDTO = CopyUtil.copyObject(reDesignDTO, DesignCollectionDTO.class); ValidateElementVO elementVO = collectionElementService.validateElement(designCollectionDTO); //计算并删除对应的未关联的element - collectionElementService.batchDelete( - calculateNoRelationElement(reDesignDTO.getCollectionId(), elementVO.getUsedElementIds())); + List longs = calculateNoRelationElement(reDesignDTO.getCollectionId(), elementVO.getUsedElementIds()); + if (!CollectionUtils.isEmpty(longs)) { + collectionElementService.batchDelete(longs); + } Design oldDesign = selectByCollectionId(reDesignDTO.getCollectionId()); //删除老的关联的design deleteByCollectionId(reDesignDTO.getCollectionId()); @@ -740,7 +742,8 @@ public class DesignServiceImpl extends ServiceImpl impleme private List calculateNoRelationElement(Long collectionId, List usedElementIds) { List collectionElements = collectionElementService.getByCollectionId(collectionId); if (CollectionUtils.isEmpty(collectionElements)) { - throw new BusinessException("get collection elements cannot be empty"); +// throw new BusinessException("get collection elements cannot be empty"); + return new ArrayList<>(); } if (CollectionUtils.isEmpty(usedElementIds)) { return collectionElements.stream().map(CollectionElement::getId).collect(Collectors.toList()); diff --git a/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java b/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java index 6d1478ec..34b7bf9a 100644 --- a/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java @@ -249,7 +249,7 @@ public class WorkspaceServiceImpl extends ServiceImpl qwOld = new QueryWrapper<>(); qwOld.lambda().eq(Workspace::getAccountId, accountId); @@ -260,7 +260,26 @@ public class WorkspaceServiceImpl extends ServiceImpl