From 2bcfcb910931ace8fef90ddd8881a4db2df66228 Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Mon, 15 Jan 2024 16:29:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E5=85=B3=E6=B3=A8=E5=8A=9F=E8=83=BD=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlatformTeamAccountController.java | 21 ++++++++++--------- .../nakadai/entity/CollectionProvider.java | 6 ++++++ .../mapper/CollectionProviderMapper.java | 2 ++ .../mapper/xml/CollectionProviderMapper.xml | 18 ++++++++++++++++ .../service/CollectionProviderService.java | 4 +++- .../impl/CollectionProviderServiceImpl.java | 4 ++++ 6 files changed, 44 insertions(+), 11 deletions(-) diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java index 0d126a9..5ecaf65 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java @@ -7,18 +7,12 @@ import com.huoran.common.exception.CustomException; import com.huoran.common.exception.ExceptionEnum; import com.huoran.common.response.R; import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.PlatformTeam; -import com.huoran.nakadai.entity.PlatformTeamAccount; -import com.huoran.nakadai.entity.PlatformTeamClassification; -import com.huoran.nakadai.entity.SupplierClassificationConfig; +import com.huoran.nakadai.entity.*; import com.huoran.nakadai.entity.req.*; import com.huoran.nakadai.entity.res.PartnerAccountResp; import com.huoran.nakadai.entity.res.PlatformTeamAccountResp; import com.huoran.nakadai.entity.vo.TeamClassificationVO; -import com.huoran.nakadai.service.PlatformTeamAccountService; -import com.huoran.nakadai.service.PlatformTeamClassificationService; -import com.huoran.nakadai.service.PlatformTeamService; -import com.huoran.nakadai.service.SupplierClassificationConfigService; +import com.huoran.nakadai.service.*; import com.huoran.nakadai.utils.GenerateCodeUtil; import com.huoran.nakadai.utils.ali.HttpUtils; import io.swagger.annotations.Api; @@ -60,6 +54,9 @@ public class PlatformTeamAccountController { @Autowired public PlatformTeamService platformTeamService; + @Autowired + public CollectionProviderService collectionProviderService; + @Autowired public PlatformTeamClassificationService platformTeamClassificationService; @@ -284,11 +281,15 @@ public class PlatformTeamAccountController { @ApiOperation(value = "查询团队信息") @GetMapping("/queryTeamInfo") - public R queryTeamInfo(@ApiParam(value = "团队id") @RequestParam("teamId") Integer teamId) { + public R queryTeamInfo(@ApiParam(value = "团队id") @RequestParam("teamId") Integer teamId, HttpServletRequest request) { + String accountId = TokenUtils.getIdByJwtToken(request); PlatformTeamClassification teamInfo = platformTeamClassificationService.getById(teamId); //查询供应商的分类信息(只有当前团队为供应商才有supplierClassification数据) List supplierClassification = platformTeamService.getTeamClassificationVOByTeamId(teamId); - return R.ok().put("teamInfo", teamInfo).put("supplierClassification", supplierClassification); + + CollectionProvider collectionProviders = collectionProviderService.getCollectionProviderByUserIdAndProviderId(teamId, Integer.valueOf(accountId)); + return R.ok().put("teamInfo", teamInfo).put("supplierClassification", supplierClassification).put("collectionInformation",collectionProviders); + } @PostMapping("/inviteJoinOrganization") diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/CollectionProvider.java b/nakadai/src/main/java/com/huoran/nakadai/entity/CollectionProvider.java index d330d9b..555ed7d 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/entity/CollectionProvider.java +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/CollectionProvider.java @@ -47,5 +47,11 @@ public class CollectionProvider implements Serializable { @TableField(fill = FieldFill.INSERT_UPDATE) private Date updateTime; + @ApiModelProperty(value = "关注id(用于取消关注,没有表示没有关注过)") + @TableField(exist = false) + private Integer attentionId; + @ApiModelProperty(value = "是否关注(0未关注 1已关注)") + @TableField(exist = false) + private Integer whetherAttention; } diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/CollectionProviderMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/CollectionProviderMapper.java index 9537377..6df57b3 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/CollectionProviderMapper.java +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/CollectionProviderMapper.java @@ -2,6 +2,7 @@ package com.huoran.nakadai.mapper; import com.huoran.nakadai.entity.CollectionProvider; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; /** *

@@ -12,5 +13,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; * @since 2024-01-12 */ public interface CollectionProviderMapper extends BaseMapper { + CollectionProvider getCollectionProviderByUserIdAndProviderId(@Param("teamId") Integer teamId,@Param("accountId") Integer accountId); } diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/CollectionProviderMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/CollectionProviderMapper.xml index 0005ec9..3e334c4 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/CollectionProviderMapper.xml +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/CollectionProviderMapper.xml @@ -2,4 +2,22 @@ + diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/CollectionProviderService.java b/nakadai/src/main/java/com/huoran/nakadai/service/CollectionProviderService.java index 94cb7a0..5bf2bb1 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/CollectionProviderService.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/CollectionProviderService.java @@ -1,7 +1,7 @@ package com.huoran.nakadai.service; -import com.huoran.nakadai.entity.CollectionProvider; import com.baomidou.mybatisplus.extension.service.IService; +import com.huoran.nakadai.entity.CollectionProvider; /** *

@@ -13,4 +13,6 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface CollectionProviderService extends IService { + //获取团队详情里面的收藏记录 + CollectionProvider getCollectionProviderByUserIdAndProviderId(Integer teamId,Integer accountId); } diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/CollectionProviderServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/CollectionProviderServiceImpl.java index 91ca97f..6f65755 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/CollectionProviderServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/CollectionProviderServiceImpl.java @@ -17,4 +17,8 @@ import org.springframework.stereotype.Service; @Service public class CollectionProviderServiceImpl extends ServiceImpl implements CollectionProviderService { + @Override + public CollectionProvider getCollectionProviderByUserIdAndProviderId(Integer teamId,Integer accountId) { + return baseMapper.getCollectionProviderByUserIdAndProviderId(teamId,accountId); + } }