| | |
| | | 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); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<AiProduct> selectList() { |
| | | return aiProductMapper.selectList( |
| | | Wrappers.lambdaQuery(AiProduct.class) |
| | | .ne(AiProduct::getState, 2) |
| | | ); |
| | | public List<AiProduct> selectList(String companyId) { |
| | | LambdaQueryWrapper<AiProduct> query = Wrappers.lambdaQuery(AiProduct.class); |
| | | if (StrUtil.isNotEmpty(companyId)){ |
| | | query.eq(AiProduct::getCompanyId, companyId); |
| | | } |
| | | query.ne(AiProduct::getState, 2); |
| | | return aiProductMapper.selectList(query); |
| | | } |
| | | |
| | | @Override |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | 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); |