Administrator
2 days ago 3b05389a5bcf93ead612761835952699a4b2e302
src/main/java/cc/mrbird/febs/ai/service/impl/AiProductServiceImpl.java
@@ -55,6 +55,9 @@
        if (StrUtil.isNotEmpty(dto.getProductCategoryId())){
            query.eq(AiProduct::getProductCategoryId, dto.getProductCategoryId());
        }
        if (StrUtil.isNotEmpty(dto.getCompanyId())){
            query.eq(AiProduct::getCompanyId, dto.getCompanyId());
        }
        query.ne(AiProduct::getState, 2);
        query.orderByDesc(AiProduct::getHotState);
        query.orderByAsc(AiProduct::getSort);
@@ -173,15 +176,18 @@
        List<String> chooseIds = dto.getChooseIds();
        AiProduct aiProduct = this.getById(chooseId);
        if (ObjectUtil.isNotNull(aiProduct)) {
            String companyId = aiProduct.getCompanyId();
            aiProductPointLinkService.deleteByQuery(
                    Wrappers.lambdaQuery(AiProductPointLink.class)
                            .eq(AiProductPointLink::getProductId,chooseId)
                            .eq(AiProductPointLink::getCompanyId,companyId)
            );
            if(CollUtil.isNotEmpty(chooseIds)){
                Date createdTime = new Date();
                for (String item : chooseIds){
                    AiProductPointLink entity = new AiProductPointLink();
                    entity.setId(UUID.getSimpleUUIDString());
                    entity.setCompanyId(companyId);
                    entity.setProductId(chooseId);
                    entity.setProductPointId(item);
                    entity.setCreatedTime(createdTime);
@@ -199,15 +205,18 @@
        List<String> chooseIds = dto.getChooseIds();
        AiProduct aiProduct = this.getById(chooseId);
        if (ObjectUtil.isNotNull(aiProduct)) {
            String companyId = aiProduct.getCompanyId();
            aiProductRoleLinkService.deleteByQuery(
                    Wrappers.lambdaQuery(AiProductRoleLink.class)
                            .eq(AiProductRoleLink::getProductId,chooseId)
                    .eq(AiProductRoleLink::getCompanyId,companyId)
            );
            if(CollUtil.isNotEmpty(chooseIds)){
                Date createdTime = new Date();
                for (String item : chooseIds){
                    AiProductRoleLink entity = new AiProductRoleLink();
                    entity.setId(UUID.getSimpleUUIDString());
                    entity.setCompanyId(companyId);
                    entity.setProductId(chooseId);
                    entity.setProductRoleId(item);
                    entity.setCreatedTime(createdTime);
@@ -224,15 +233,18 @@
        List<String> chooseIds = dto.getChooseIds();
        AiProduct aiProduct = this.getById(chooseId);
        if (ObjectUtil.isNotNull(aiProduct)) {
            String companyId = aiProduct.getCompanyId();
            aiProductQuestionLinkService.deleteByQuery(
                    Wrappers.lambdaQuery(AiProductQuestionLink.class)
                            .eq(AiProductQuestionLink::getProductId,chooseId)
                    .eq(AiProductQuestionLink::getCompanyId,companyId)
            );
            if(CollUtil.isNotEmpty(chooseIds)){
                Date createdTime = new Date();
                for (String item : chooseIds){
                    AiProductQuestionLink entity = new AiProductQuestionLink();
                    entity.setId(UUID.getSimpleUUIDString());
                    entity.setCompanyId(companyId);
                    entity.setProductId(chooseId);
                    entity.setProductQuestionId(item);
                    entity.setCreatedTime(createdTime);