供应商详情关注功能提交

main
rong.liu 11 months ago
parent c3aec6b7fd
commit 2bcfcb9109
  1. 21
      nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java
  2. 6
      nakadai/src/main/java/com/huoran/nakadai/entity/CollectionProvider.java
  3. 2
      nakadai/src/main/java/com/huoran/nakadai/mapper/CollectionProviderMapper.java
  4. 18
      nakadai/src/main/java/com/huoran/nakadai/mapper/xml/CollectionProviderMapper.xml
  5. 4
      nakadai/src/main/java/com/huoran/nakadai/service/CollectionProviderService.java
  6. 4
      nakadai/src/main/java/com/huoran/nakadai/service/impl/CollectionProviderServiceImpl.java

@ -7,18 +7,12 @@ import com.huoran.common.exception.CustomException;
import com.huoran.common.exception.ExceptionEnum; import com.huoran.common.exception.ExceptionEnum;
import com.huoran.common.response.R; import com.huoran.common.response.R;
import com.huoran.common.utils.TokenUtils; import com.huoran.common.utils.TokenUtils;
import com.huoran.nakadai.entity.PlatformTeam; import com.huoran.nakadai.entity.*;
import com.huoran.nakadai.entity.PlatformTeamAccount;
import com.huoran.nakadai.entity.PlatformTeamClassification;
import com.huoran.nakadai.entity.SupplierClassificationConfig;
import com.huoran.nakadai.entity.req.*; import com.huoran.nakadai.entity.req.*;
import com.huoran.nakadai.entity.res.PartnerAccountResp; import com.huoran.nakadai.entity.res.PartnerAccountResp;
import com.huoran.nakadai.entity.res.PlatformTeamAccountResp; import com.huoran.nakadai.entity.res.PlatformTeamAccountResp;
import com.huoran.nakadai.entity.vo.TeamClassificationVO; import com.huoran.nakadai.entity.vo.TeamClassificationVO;
import com.huoran.nakadai.service.PlatformTeamAccountService; import com.huoran.nakadai.service.*;
import com.huoran.nakadai.service.PlatformTeamClassificationService;
import com.huoran.nakadai.service.PlatformTeamService;
import com.huoran.nakadai.service.SupplierClassificationConfigService;
import com.huoran.nakadai.utils.GenerateCodeUtil; import com.huoran.nakadai.utils.GenerateCodeUtil;
import com.huoran.nakadai.utils.ali.HttpUtils; import com.huoran.nakadai.utils.ali.HttpUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -60,6 +54,9 @@ public class PlatformTeamAccountController {
@Autowired @Autowired
public PlatformTeamService platformTeamService; public PlatformTeamService platformTeamService;
@Autowired
public CollectionProviderService collectionProviderService;
@Autowired @Autowired
public PlatformTeamClassificationService platformTeamClassificationService; public PlatformTeamClassificationService platformTeamClassificationService;
@ -284,11 +281,15 @@ public class PlatformTeamAccountController {
@ApiOperation(value = "查询团队信息") @ApiOperation(value = "查询团队信息")
@GetMapping("/queryTeamInfo") @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); PlatformTeamClassification teamInfo = platformTeamClassificationService.getById(teamId);
//查询供应商的分类信息(只有当前团队为供应商才有supplierClassification数据) //查询供应商的分类信息(只有当前团队为供应商才有supplierClassification数据)
List<TeamClassificationVO> supplierClassification = platformTeamService.getTeamClassificationVOByTeamId(teamId); List<TeamClassificationVO> 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") @PostMapping("/inviteJoinOrganization")

@ -47,5 +47,11 @@ public class CollectionProvider implements Serializable {
@TableField(fill = FieldFill.INSERT_UPDATE) @TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime; private Date updateTime;
@ApiModelProperty(value = "关注id(用于取消关注,没有表示没有关注过)")
@TableField(exist = false)
private Integer attentionId;
@ApiModelProperty(value = "是否关注(0未关注 1已关注)")
@TableField(exist = false)
private Integer whetherAttention;
} }

@ -2,6 +2,7 @@ package com.huoran.nakadai.mapper;
import com.huoran.nakadai.entity.CollectionProvider; import com.huoran.nakadai.entity.CollectionProvider;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/** /**
* <p> * <p>
@ -12,5 +13,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @since 2024-01-12 * @since 2024-01-12
*/ */
public interface CollectionProviderMapper extends BaseMapper<CollectionProvider> { public interface CollectionProviderMapper extends BaseMapper<CollectionProvider> {
CollectionProvider getCollectionProviderByUserIdAndProviderId(@Param("teamId") Integer teamId,@Param("accountId") Integer accountId);
} }

@ -2,4 +2,22 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huoran.nakadai.mapper.CollectionProviderMapper"> <mapper namespace="com.huoran.nakadai.mapper.CollectionProviderMapper">
<select id="getCollectionProviderByUserIdAndProviderId"
resultType="com.huoran.nakadai.entity.CollectionProvider">
SELECT
( SELECT p.id FROM collection_provider p WHERE p.supplier_account_id = a.account_id AND p.account_id = #{accountId} ) AS attentionId,
IF
(
( SELECT p.id FROM collection_provider p WHERE p.supplier_account_id = a.account_id AND p.account_id = #{accountId} ) IS NULL,
0,
1
) AS whetherAttention
FROM
k_platform_team_classification c
INNER JOIN k_platform_team t ON t.classification_id = c.id
INNER JOIN k_platform_team_account a ON a.manage_id = t.manage_id
WHERE
c.id = #{teamId}
AND c.is_del = 0
</select>
</mapper> </mapper>

@ -1,7 +1,7 @@
package com.huoran.nakadai.service; package com.huoran.nakadai.service;
import com.huoran.nakadai.entity.CollectionProvider;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.huoran.nakadai.entity.CollectionProvider;
/** /**
* <p> * <p>
@ -13,4 +13,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface CollectionProviderService extends IService<CollectionProvider> { public interface CollectionProviderService extends IService<CollectionProvider> {
//获取团队详情里面的收藏记录
CollectionProvider getCollectionProviderByUserIdAndProviderId(Integer teamId,Integer accountId);
} }

@ -17,4 +17,8 @@ import org.springframework.stereotype.Service;
@Service @Service
public class CollectionProviderServiceImpl extends ServiceImpl<CollectionProviderMapper, CollectionProvider> implements CollectionProviderService { public class CollectionProviderServiceImpl extends ServiceImpl<CollectionProviderMapper, CollectionProvider> implements CollectionProviderService {
@Override
public CollectionProvider getCollectionProviderByUserIdAndProviderId(Integer teamId,Integer accountId) {
return baseMapper.getCollectionProviderByUserIdAndProviderId(teamId,accountId);
}
} }

Loading…
Cancel
Save