Commit c4822046 authored by 刘基明's avatar 刘基明

Merge branch 'dev' of 47.100.44.39:tp-backend/tanpu-community into dev

parents f243eba3 ab679718
package com.tanpu.community.api.beans.resp;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import java.math.BigDecimal;
/**
* @description:
* @author: zejia zj wu
* @create: 2021-07-19 15:47
**/
@Data
@Builder
@ApiModel(description = "客户信息")
public class Customer {
@ApiModelProperty("用户id")
private String userId;//用户id
@ApiModelProperty("姓名")
private String userName;//
@ApiModelProperty("手机号")
private String phone;//
@ApiModelProperty("总资产")
private BigDecimal totalMarket;
}
package com.tanpu.community.api.beans.vo.feign.fatools;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @description: 用户信息 圈子使用
* @author: zejia zj wu
* @create: 2021-07-15 14:37
**/
@Data
@Builder
@ApiModel(description = "用户信息 圈子使用")
public class UserInfoNew implements Serializable {
@ApiModelProperty("主页等级 1普通主页 2首席投顾主页 3机构主页")
private Integer personalCenterType;
@ApiModelProperty("是否显示关注按钮 0不显示 1显示")
private Integer isShowFollowButton;
@ApiModelProperty("关注按钮状态 0未关注 1已关注")
private Integer showFollowStatus;
@ApiModelProperty("粉丝数")
private Integer fansNumber = 0;
@ApiModelProperty("关注数")
private Integer followNumber = 0;
@ApiModelProperty("课程数")
private Integer courseNumber = 0;
@ApiModelProperty("基金数")
private Integer fundNumber = 0;
@ApiModelProperty("成立时间")
private long founded;
@ApiModelProperty("备案编号")
private String recordNumber = "-";
@ApiModelProperty("团队成员")
private List<UserInfoOrg> userInfoOrgList;
//↓↓↓↓ 通用 ↓↓↓↓
@ApiModelProperty("用户id")
private String userId;//用户id
@ApiModelProperty("昵称")
private String nickName;//昵称
@ApiModelProperty("地址")
private String address;//地址
@ApiModelProperty("性别 0:男 1:女")
private String gender;//性别 0:男 1:女
@ApiModelProperty("个人简介")
private String introduction;//个人简介
@ApiModelProperty("头像")
private String headImageUrl;//头像
@ApiModelProperty("全新用户等级体系 详见 UserLevelEnum")
private Integer levelGrade;
@ApiModelProperty("当levelGrade=10有值 1投资萌新 2投资达人")
private String userInvestorType;
@ApiModelProperty("用户类型 1普通账号 2机构账号 3机构人员")
private Integer userType;
@ApiModelProperty("专家投顾 认证信息")
private String certInfo;
// 机构人员
@ApiModelProperty("认证职位")
private String certPosition;
@ApiModelProperty("名片是否已通过上传(是否展示工作室入口) 0不通过 1通过")
private Integer ocrStatus;
@ApiModelProperty("所属机构id")
private String belongUserOrgId;
@ApiModelProperty("所属机构名")
private String belongUserOrgName;
//工作室相关
@ApiModelProperty("工作室名")
private String workshopName;//工作室名
@ApiModelProperty("工作室简介")
private String workshopIntroduction;//工作室简介
//↓↓↓↓↓首席投顾↓↓↓↓↓↓
@ApiModelProperty(value = "姓名")
private String userName;
@ApiModelProperty(value = "头像背图url")
private String backImageUrl;
@ApiModelProperty(value = "是否展示专访视频 0不展示 1展示")
private Integer interviewVideoIsShow;
@ApiModelProperty(value = "专访视频 标题")
private String interviewVideoTitle;
@ApiModelProperty(value = "专访视频 url")
private String interviewVideoUrl;
@ApiModelProperty(value = "个人简介")
private String personalProfile;
@ApiModelProperty(value = "管理规模")
private String managementScale;
@ApiModelProperty(value = "从业年限 (单位:年)")
private String workingYears;
@ApiModelProperty(value = "投资理念")
private String investmentPhilosophy;
@ApiModelProperty(value = "擅长领域")
private String areasOfExpertise;
@ApiModelProperty(value = "证书 json")
private String credentials;
@ApiModelProperty(value = "成功案例客户id")
private String clientId;
//↓↓↓↓ 机构 ↓↓↓↓
@ApiModelProperty(value = "申请用户id")
private String applyUserId;
@ApiModelProperty(value = "机构id")
private String userIdOrg;
@ApiModelProperty(value = "公司名称")
private String companyName;
@ApiModelProperty(value = "公司全称")
private String companyFullName;
@ApiModelProperty(value = "营业执照账号")
private String businessLicenseNumber;
@ApiModelProperty(value = "营业执照 图片url")
private String businessLicenseImageUrl;
@ApiModelProperty(value = "机构用户身份公函 url")
private String identityLetterUrl;
@ApiModelProperty(value = "机构认证信息登记表 url")
private String orgAuthInfoFormUrl;
@ApiModelProperty(value = "运营人员 职位")
private String position;
@ApiModelProperty(value = "审核状态 1初始提交 2审核不通过 3审核通过")
private Integer auditStatus;
@ApiModelProperty(value = "认证名称")
private String certName;
@ApiModelProperty(value = "是否匹配现有基金公司 0不匹配 1匹配")
private Integer isExistOrg;
@ApiModelProperty(value = "所属基金公司id")
private String belongOrgId;
@ApiModelProperty(value = "所属基金公司类型 0公募 1私募")
private Integer belongOrgType;
}
\ No newline at end of file
package com.tanpu.community.api.beans.vo.feign.fatools;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
/**
* @description: 机构人员信息
* @author: zejia zj wu
* @create: 2021-07-18 20:06
**/
@Data
@Builder
@ApiModel(description = "用户信息 机构人员信息")
public class UserInfoOrg {
@ApiModelProperty("用户id")
private String userId;//用户id
@ApiModelProperty("昵称")
private String nickName;//昵称
@ApiModelProperty("个人简介")
private String introduction;//个人简介
@ApiModelProperty("头像")
private String headImageUrl;//头像
@ApiModelProperty("认证职位")
private String certPosition;
@ApiModelProperty("是否已关注 0未关注 1已关注")
private Integer isFollower = 0;
}
...@@ -9,6 +9,8 @@ import com.tanpu.community.api.beans.req.homepage.FollowRelReq; ...@@ -9,6 +9,8 @@ import com.tanpu.community.api.beans.req.homepage.FollowRelReq;
import com.tanpu.community.api.beans.req.homepage.QueryFollowReq; import com.tanpu.community.api.beans.req.homepage.QueryFollowReq;
import com.tanpu.community.api.beans.req.homepage.QueryRecordThemeReq; import com.tanpu.community.api.beans.req.homepage.QueryRecordThemeReq;
import com.tanpu.community.api.beans.req.page.Page; import com.tanpu.community.api.beans.req.page.Page;
import com.tanpu.community.api.beans.resp.Customer;
import com.tanpu.community.api.beans.vo.feign.fatools.UserInfoNew;
import com.tanpu.community.manager.HomePageManager; import com.tanpu.community.manager.HomePageManager;
import com.tanpu.community.manager.ThemeManager; import com.tanpu.community.manager.ThemeManager;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -34,7 +36,25 @@ public class HomePageController { ...@@ -34,7 +36,25 @@ public class HomePageController {
@Resource @Resource
private UserHolder userHolder; private UserHolder userHolder;
// 用户信息查询 (供圈子服务调用)
@ApiOperation(value = "个人中心 查询")
@GetMapping(value = "/queryUserInfoNew")
@AuthLogin
public CommonResp<UserInfoNew> queryUsersListNew(@RequestParam("userId") String userId){
String userIdMyself = userHolder.getUserId();
return CommonResp.success(homePageManager.queryUsersListNew(userIdMyself,userId));
}
// 理财师客户列表查询 (供圈子服务调用)
@ApiOperation(value = "个人中心 理财师客户列表查询")
@GetMapping(value = "/queryUserCustomerList")
@AuthLogin
public CommonResp<List<Customer>> queryUserCustomerList(){
String userId = userHolder.getUserId();
return CommonResp.success(homePageManager.queryUserCustomerList(userId));
}
@PostMapping(value = "/followList") @PostMapping(value = "/followList")
@ApiOperation("查询关注/粉丝列表") @ApiOperation("查询关注/粉丝列表")
@ResponseBody @ResponseBody
......
package com.tanpu.community.dao;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import com.tanpu.community.api.CommunityConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import javax.sql.DataSource;
/**
* created by xd on 2021/6/3
*/
@Configuration
@Slf4j
@MapperScan(basePackages = CommunityConstant.PACKAGE_BASE + ".dao.mapper.fund", sqlSessionTemplateRef = "fundSqlSessionTemplate")
public class FundDataSourceConfig {
@ConfigurationProperties(prefix = "spring.datasource.fund")
@Bean(name = "fundDataSource")
public DataSource dataSource() {
return DataSourceBuilder.create().build();
}
@Bean(name = "fundSqlSessionFactory")
public SqlSessionFactory sqlSessionFactory(@Qualifier("fundDataSource") DataSource dataSource) throws Exception {
MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean();
bean.setDataSource(dataSource);
bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(
"classpath*:mapper/fund/*.xml"));
return bean.getObject();
}
@Bean(name = "fundTransactionManager")
public DataSourceTransactionManager fundTransactionManager(@Qualifier("fundDataSource") DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
@Bean(name = "fundSqlSessionTemplate")
public SqlSessionTemplate fundSqlSessionTemplate(@Qualifier("fundSqlSessionFactory") SqlSessionFactory sqlSessionFactory) {
return new SqlSessionTemplate(sqlSessionFactory);
}
}
package com.tanpu.community.dao;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import com.tanpu.community.api.CommunityConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import javax.sql.DataSource;
/**
* created by xd on 2021/6/3
*/
@Configuration
@Slf4j
@MapperScan(basePackages = CommunityConstant.PACKAGE_BASE + ".dao.mapper.jydb", sqlSessionTemplateRef = "jydbSqlSessionTemplate")
public class JydbDataSourceConfig {
@ConfigurationProperties(prefix = "spring.datasource.jydb")
@Bean(name = "jydbDataSource")
public DataSource dataSource() {
return DataSourceBuilder.create().build();
}
@Bean(name = "jydbSqlSessionFactory")
public SqlSessionFactory sqlSessionFactory(@Qualifier("jydbDataSource") DataSource dataSource) throws Exception {
MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean();
bean.setDataSource(dataSource);
bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(
"classpath*:mapper/jydb/*.xml"));
return bean.getObject();
}
@Bean(name = "jydbTransactionManager")
public DataSourceTransactionManager jydbTransactionManager(@Qualifier("jydbDataSource") DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
@Bean(name = "jydbSqlSessionTemplate")
public SqlSessionTemplate jydbSqlSessionTemplate(@Qualifier("jydbSqlSessionFactory") SqlSessionFactory sqlSessionFactory) {
return new SqlSessionTemplate(sqlSessionFactory);
}
}
package com.tanpu.community.dao.entity.jydb;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Builder;
import lombok.Data;
@ApiModel(value="com-tanpu-community-dao-entity-jydb-MfInvestadvisoroutline")
@Data
@Builder
@TableName(value = "mf_investadvisoroutline")
public class MfInvestadvisoroutline implements Serializable {
/**
* ID
*/
@TableField(value = "ID")
@ApiModelProperty(value="ID")
private Long id;
/**
* 基金公司代码
*/
@TableField(value = "InvestAdvisorCode")
@ApiModelProperty(value="基金公司代码")
private Integer investadvisorcode;
/**
* 基金管理人名称
*/
@TableField(value = "InvestAdvisorName")
@ApiModelProperty(value="基金管理人名称")
private String investadvisorname;
/**
* 基金管理人简称
*/
@TableField(value = "InvestAdvisorAbbrName")
@ApiModelProperty(value="基金管理人简称")
private String investadvisorabbrname;
/**
* 法人代表
*/
@TableField(value = "LegalRepr")
@ApiModelProperty(value="法人代表")
private String legalrepr;
/**
* 总经理
*/
@TableField(value = "GeneralManager")
@ApiModelProperty(value="总经理")
private String generalmanager;
/**
* 公司成立日期
*/
@TableField(value = "EstablishmentDate")
@ApiModelProperty(value="公司成立日期")
private Date establishmentdate;
/**
* 组织形式
*/
@TableField(value = "OrganizationForm")
@ApiModelProperty(value="组织形式")
private String organizationform;
/**
* 注册资本(元)
*/
@TableField(value = "RegCapital")
@ApiModelProperty(value="注册资本(元)")
private BigDecimal regcapital;
/**
* 公司注册地址
*/
@TableField(value = "RegAddr")
@ApiModelProperty(value="公司注册地址")
private String regaddr;
/**
* 公司办公地址
*/
@TableField(value = "OfficeAddr")
@ApiModelProperty(value="公司办公地址")
private String officeaddr;
/**
* 邮编
*/
@TableField(value = "ZipCode")
@ApiModelProperty(value="邮编")
private String zipcode;
/**
* 邮箱
*/
@TableField(value = "Email")
@ApiModelProperty(value="邮箱")
private String email;
/**
* 公司联系地址
*/
@TableField(value = "ContactAddr")
@ApiModelProperty(value="公司联系地址")
private String contactaddr;
/**
* 电话
*/
@TableField(value = "Tel")
@ApiModelProperty(value="电话")
private String tel;
/**
* 传真
*/
@TableField(value = "Fax")
@ApiModelProperty(value="传真")
private String fax;
/**
* 公司网址
*/
@TableField(value = "WebSite")
@ApiModelProperty(value="公司网址")
private String website;
/**
* 联系人
*/
@TableField(value = "LinkMan")
@ApiModelProperty(value="联系人")
private String linkman;
/**
* 简历
*/
@TableField(value = "Background")
@ApiModelProperty(value="简历")
private String background;
/**
* 所属地区
*/
@TableField(value = "Region")
@ApiModelProperty(value="所属地区")
private Integer region;
/**
* 修改日期
*/
@TableField(value = "XGRQ")
@ApiModelProperty(value="修改日期")
private Date xgrq;
/**
* JSID
*/
@TableField(value = "JSID")
@ApiModelProperty(value="JSID")
private Long jsid;
/**
* 客服热线
*/
@TableField(value = "ServiceLine")
@ApiModelProperty(value="客服热线")
private String serviceline;
/**
* 存续截止日
*/
@TableField(value = "MaturityEndDate")
@ApiModelProperty(value="存续截止日")
private Date maturityenddate;
/**
* 注册登记代码
*/
@TableField(value = "TACode")
@ApiModelProperty(value="注册登记代码")
private String tacode;
/**
* 证监会标识码
*/
@TableField(value = "CSRCCode")
@ApiModelProperty(value="证监会标识码")
private String csrccode;
private static final long serialVersionUID = 1L;
public static final String COL_ID = "ID";
public static final String COL_INVESTADVISORCODE = "InvestAdvisorCode";
public static final String COL_INVESTADVISORNAME = "InvestAdvisorName";
public static final String COL_INVESTADVISORABBRNAME = "InvestAdvisorAbbrName";
public static final String COL_LEGALREPR = "LegalRepr";
public static final String COL_GENERALMANAGER = "GeneralManager";
public static final String COL_ESTABLISHMENTDATE = "EstablishmentDate";
public static final String COL_ORGANIZATIONFORM = "OrganizationForm";
public static final String COL_REGCAPITAL = "RegCapital";
public static final String COL_REGADDR = "RegAddr";
public static final String COL_OFFICEADDR = "OfficeAddr";
public static final String COL_ZIPCODE = "ZipCode";
public static final String COL_EMAIL = "Email";
public static final String COL_CONTACTADDR = "ContactAddr";
public static final String COL_TEL = "Tel";
public static final String COL_FAX = "Fax";
public static final String COL_WEBSITE = "WebSite";
public static final String COL_LINKMAN = "LinkMan";
public static final String COL_BACKGROUND = "Background";
public static final String COL_REGION = "Region";
public static final String COL_XGRQ = "XGRQ";
public static final String COL_JSID = "JSID";
public static final String COL_SERVICELINE = "ServiceLine";
public static final String COL_MATURITYENDDATE = "MaturityEndDate";
public static final String COL_TACODE = "TACode";
public static final String COL_CSRCCODE = "CSRCCode";
}
\ No newline at end of file
package com.tanpu.community.dao.mapper.fund;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanpu.community.dao.entity.fund.CompanyInfo;
public interface CompanyInfoMapper extends BaseMapper<CompanyInfo> {
}
\ No newline at end of file
package com.tanpu.community.dao.mapper.fund;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanpu.community.dao.entity.fund.FundInfo;
public interface FundInfoMapper extends BaseMapper<FundInfo> {
}
\ No newline at end of file
package com.tanpu.community.dao.mapper.jydb;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanpu.community.dao.entity.jydb.MfAdvisorscalerank;
public interface MfAdvisorscalerankMapper extends BaseMapper<MfAdvisorscalerank> {
}
\ No newline at end of file
package com.tanpu.community.dao.mapper.jydb;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanpu.community.dao.entity.jydb.MfInvestadvisoroutline;
public interface MfInvestadvisoroutlineMapper extends BaseMapper<MfInvestadvisoroutline> {
}
\ No newline at end of file
...@@ -14,8 +14,8 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -14,8 +14,8 @@ import org.springframework.web.bind.annotation.RequestParam;
import java.util.List; import java.util.List;
//@FeignClient(value = "service-course", contextId = "course", fallbackFactory = FeignBackClientForProducts.class, url = "${tamp-course-order-svc:}") //@FeignClient(value = "service-course", contextId = "course", fallbackFactory = FeignBackClientForCourse.class, url = "${tamp-course-order-svc:}")
@FeignClient(value = "service-course", contextId = "course", fallbackFactory = FeignBackClientForProducts.class, url = "http://172.20.1.249:8060/course") @FeignClient(value = "service-course", contextId = "course", fallbackFactory = FeignBackClientForCourse.class, url = "http://172.20.1.249:8060/course")
public interface FeignClientForCourse { public interface FeignClientForCourse {
......
package com.tanpu.community.feign.diagnose;
import com.tanpu.common.api.CommonResp;
import com.tanpu.community.api.beans.resp.Customer;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.List;
@Slf4j
@Component
public class FeignBackClientForDiagnose implements FallbackFactory<FeignClientForDiagnose> {
@Override
public FeignClientForDiagnose create(Throwable throwable) {
return new FeignClientForDiagnose() {
@Override
public CommonResp<List<Customer>> getIfaCustomerList(String ifaId) {
log.error("请求信息", throwable);
log.error("FeignClientForDiagnose.getIfaCustomerList-查询理财师客户的id:{}", ifaId);
return CommonResp.failed("getIfaCustomerList");
}
};
}
}
package com.tanpu.community.feign.diagnose;
import com.tanpu.common.api.CommonResp;
import com.tanpu.community.api.beans.resp.Customer;
import com.tanpu.community.api.beans.vo.feign.course.CourseDetailExt;
import com.tanpu.community.api.beans.vo.feign.course.CoursePackageDetail;
import com.tanpu.community.api.beans.vo.feign.course.CourseSimpleResp;
import com.tanpu.community.feign.product.FeignBackClientForProducts;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
//@FeignClient(value = "service-diagnose", contextId = "diagnose", fallbackFactory = FeignBackClientForDiagnose.class, url = "${tamp-diagnose-svc:}")
@FeignClient(value = "service-diagnose", contextId = "diagnose", fallbackFactory = FeignBackClientForDiagnose.class, path = "http://172.20.1.249:8201/diagnose")
public interface FeignClientForDiagnose {
@ApiOperation("查询理财师关联客户信息")
@GetMapping("/ifa/customer/simplelist")
CommonResp<List<Customer>> getIfaCustomerList(@ApiParam("理财师ID") @RequestParam("ifaId") String ifaId);
}
package com.tanpu.community.feign.fatools; package com.tanpu.community.feign.fatools;
import com.tanpu.common.api.CommonResp; import com.tanpu.common.api.CommonResp;
import com.tanpu.community.api.beans.vo.feign.user.FileQueryResp;
import com.tanpu.community.api.beans.vo.feign.course.ShortVideoBaseInfoResp; import com.tanpu.community.api.beans.vo.feign.course.ShortVideoBaseInfoResp;
import com.tanpu.community.api.beans.vo.feign.fatools.UserInfoNew;
import com.tanpu.community.api.beans.vo.feign.fatools.UserInfoOrg;
import com.tanpu.community.api.beans.vo.feign.user.FileQueryResp;
import com.tanpu.community.api.beans.vo.feign.user.UserInfoVo; import com.tanpu.community.api.beans.vo.feign.user.UserInfoVo;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import java.util.List; import java.util.List;
...@@ -33,4 +37,14 @@ public interface FeignClientForFatools { ...@@ -33,4 +37,14 @@ public interface FeignClientForFatools {
@ApiOperation(value = "查询附件") @ApiOperation(value = "查询附件")
@GetMapping(value = "/file/queryFileMap") @GetMapping(value = "/file/queryFileMap")
Map<String, FileQueryResp> queryFileMap(@RequestParam("ids") List<String> ids); Map<String, FileQueryResp> queryFileMap(@RequestParam("ids") List<String> ids);
// 用户信息查询 (供圈子服务调用)
@ApiOperation(value = "查询用户信息")
@GetMapping(value = "/queryUserInfoNew")
CommonResp<UserInfoNew> queryUsersListNew(@RequestParam("userId") String userId);
@ApiOperation(value = "根据机构用户id 查询旗下机构用户信息")
@GetMapping(value = "/getUsetInfoByOrgUserId")
CommonResp<List<UserInfoOrg>> getUsetInfoByOrgUserId(@RequestParam("orgUserId") String orgUserId);
} }
package com.tanpu.community.feign.fatools; package com.tanpu.community.feign.fatools;
import com.tanpu.common.api.CommonResp; import com.tanpu.common.api.CommonResp;
import com.tanpu.community.api.beans.vo.feign.user.FileQueryResp;
import com.tanpu.community.api.beans.vo.feign.course.ShortVideoBaseInfoResp; import com.tanpu.community.api.beans.vo.feign.course.ShortVideoBaseInfoResp;
import com.tanpu.community.api.beans.vo.feign.fatools.UserInfoNew;
import com.tanpu.community.api.beans.vo.feign.fatools.UserInfoOrg;
import com.tanpu.community.api.beans.vo.feign.user.FileQueryResp;
import com.tanpu.community.api.beans.vo.feign.user.UserInfoVo; import com.tanpu.community.api.beans.vo.feign.user.UserInfoVo;
import feign.hystrix.FallbackFactory; import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -42,6 +44,18 @@ public class FeignbackForFatools implements FallbackFactory<FeignClientForFatool ...@@ -42,6 +44,18 @@ public class FeignbackForFatools implements FallbackFactory<FeignClientForFatool
log.info("FeignbackForFatools.getNotRelaySet", throwable); log.info("FeignbackForFatools.getNotRelaySet", throwable);
return CommonResp.error(); return CommonResp.error();
} }
@Override
public CommonResp<UserInfoNew> queryUsersListNew(String userId) {
log.info("FeignbackForFatools.queryUsersListNew", throwable);
return CommonResp.error();
}
@Override
public CommonResp<List<UserInfoOrg>> getUsetInfoByOrgUserId(String orgUserId) {
log.info("FeignbackForFatools.getUsetInfoByOrgUserId", throwable);
return CommonResp.error();
}
}; };
} }
......
package com.tanpu.community.feign.tanpuroom; package com.tanpu.community.feign.tanpuroom;
import com.tanpu.common.api.CommonResp; import com.tanpu.common.api.CommonResp;
import com.tanpu.community.api.beans.req.page.Pageable;
import com.tanpu.community.api.beans.vo.feign.course.CurriCulumInfoDetailDto; import com.tanpu.community.api.beans.vo.feign.course.CurriCulumInfoDetailDto;
import com.tanpu.community.api.beans.vo.feign.course.CurriculumDetailVo; import com.tanpu.community.api.beans.vo.feign.course.CurriculumDetailVo;
import com.tanpu.community.api.beans.vo.feign.course.ShortVideoBaseInfoResp; import com.tanpu.community.api.beans.vo.feign.course.ShortVideoBaseInfoResp;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -25,4 +27,8 @@ public interface FeignClientForTanpuroom { ...@@ -25,4 +27,8 @@ public interface FeignClientForTanpuroom {
@ApiOperation(value = "查询精品课详情") @ApiOperation(value = "查询精品课详情")
@PostMapping(value = "/curriculumInfos/detail", produces = {"application/json"}) @PostMapping(value = "/curriculumInfos/detail", produces = {"application/json"})
CommonResp<CurriculumDetailVo> queryCurriculumDetail(@RequestBody CurriCulumInfoDetailDto req); CommonResp<CurriculumDetailVo> queryCurriculumDetail(@RequestBody CurriCulumInfoDetailDto req);
@ApiOperation("已购总数")
@GetMapping("/my/order/count")
CommonResp<Integer> myOrderCount(@ApiParam(value = "userId", required = true) @RequestParam("userId") String userId);
} }
package com.tanpu.community.manager; package com.tanpu.community.manager;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanpu.common.api.CommonResp;
import com.tanpu.common.constant.BizStatus;
import com.tanpu.common.exception.BizException;
import com.tanpu.community.api.beans.qo.FollowQo; import com.tanpu.community.api.beans.qo.FollowQo;
import com.tanpu.community.api.beans.req.homepage.FollowRelReq; import com.tanpu.community.api.beans.req.homepage.FollowRelReq;
import com.tanpu.community.api.beans.req.homepage.QueryFollowReq; import com.tanpu.community.api.beans.req.homepage.QueryFollowReq;
import com.tanpu.community.api.beans.req.page.Page; import com.tanpu.community.api.beans.req.page.Page;
import com.tanpu.community.api.beans.resp.Customer;
import com.tanpu.community.api.beans.vo.feign.fatools.UserInfoNew;
import com.tanpu.community.api.beans.vo.feign.fatools.UserInfoOrg;
import com.tanpu.community.api.enums.OperationTypeEnum; import com.tanpu.community.api.enums.OperationTypeEnum;
import com.tanpu.community.api.enums.QueryFollowTypeEnum; import com.tanpu.community.api.enums.QueryFollowTypeEnum;
import com.tanpu.community.dao.entity.community.FollowRelEntity;
import com.tanpu.community.dao.entity.fund.CompanyInfo;
import com.tanpu.community.dao.entity.fund.FundInfo;
import com.tanpu.community.dao.entity.jydb.MfAdvisorscalerank;
import com.tanpu.community.dao.entity.jydb.MfInvestadvisoroutline;
import com.tanpu.community.dao.entity.user.UserInfoEntity; import com.tanpu.community.dao.entity.user.UserInfoEntity;
import com.tanpu.community.dao.mapper.community.FollowRelMapper;
import com.tanpu.community.dao.mapper.fund.CompanyInfoMapper;
import com.tanpu.community.dao.mapper.fund.FundInfoMapper;
import com.tanpu.community.dao.mapper.jydb.MfAdvisorscalerankMapper;
import com.tanpu.community.dao.mapper.jydb.MfInvestadvisoroutlineMapper;
import com.tanpu.community.feign.diagnose.FeignClientForDiagnose;
import com.tanpu.community.feign.fatools.FeignClientForFatools;
import com.tanpu.community.feign.tanpuroom.FeignClientForTanpuroom;
import com.tanpu.community.service.FollowRelService; import com.tanpu.community.service.FollowRelService;
import com.tanpu.community.service.UserInfoService; import com.tanpu.community.service.UserInfoService;
import com.tanpu.community.util.ConvertUtil; import com.tanpu.community.util.ConvertUtil;
import com.tanpu.community.util.PageUtils; import com.tanpu.community.util.PageUtils;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*; import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
...@@ -23,10 +47,131 @@ public class HomePageManager { ...@@ -23,10 +47,131 @@ public class HomePageManager {
@Autowired @Autowired
private FollowRelService followRelService; private FollowRelService followRelService;
@Autowired @Autowired
private UserInfoService userInfoService; private UserInfoService userInfoService;
@Resource
private FeignClientForFatools feignClientForFatools;
@Resource
private FollowRelMapper followRelMapper;
@Resource
private MfInvestadvisoroutlineMapper mfInvestadvisoroutlineMapper;
@Resource
private MfAdvisorscalerankMapper mfAdvisorscalerankMapper;
@Resource
private CompanyInfoMapper companyInfoMapper;
@Resource
private FundInfoMapper fundInfoMapper;
@Resource
private FeignClientForTanpuroom feignClientForTanpuroom;
@Resource
private FeignClientForDiagnose feignClientForDiagnose;
//查询 个人中心 相关信息
public UserInfoNew queryUsersListNew(String userIdMyself, String userId) {
CommonResp<UserInfoNew> userInfoNewCommonResp = feignClientForFatools.queryUsersListNew(StringUtils.isNotBlank(userId) ? userId : userIdMyself);
if (userInfoNewCommonResp.isNotSuccess()) new BizException("内部接口调用失败");
UserInfoNew userInfoNew = userInfoNewCommonResp.getData();
// 关注 按钮的显示逻辑
if (StringUtils.isNotBlank(userId)) { //查询别人的个人主页
userInfoNew.setIsShowFollowButton(0);
//是否已关注
FollowRelEntity followRelEntity = followRelService.queryRecord(userId, userIdMyself);
if (ObjectUtils.allNotNull(followRelEntity) && BizStatus.DeleteTag.tag_init == followRelEntity.getDeleteTag()){
userInfoNew.setShowFollowStatus(1); // 已关注
} else {
userInfoNew.setShowFollowStatus(0); // 未关注
}
} else {
// 查询自己的主页
userInfoNew.setIsShowFollowButton(1);
userId = userIdMyself;
}
//设置粉丝数 关注数
getFansNUmAndFollowNum(userInfoNew);
// 主页类型 显示逻辑
if (50 == userInfoNew.getLevelGrade()){
userInfoNew.setPersonalCenterType(2);
// 首席投顾 添加专栏信息 (前端自己取)
// 成功案例客户
// 默认显示该投顾管理的客户里,总资产最高的客户
if (StringUtils.isBlank(userInfoNew.getClientId())) {
List<Customer> customers = queryUserCustomerList(userId);
Optional<Customer> first = customers.stream().sorted(Comparator.comparing(Customer::getTotalMarket)).findFirst();
if (first.isPresent()) {
userInfoNew.setClientId(first.get().getUserId());
} else {
userInfoNew.setClientId(null);
}
}
} else if (2 == userInfoNew.getUserType()){
// 机构账号
userInfoNew.setPersonalCenterType(3);
if (0 == userInfoNew.getBelongOrgType() && StringUtils.isNotBlank(userInfoNew.getBelongOrgId())){ // 公募
//设置 基金数
MfAdvisorscalerank mfAdvisorscalerank = mfAdvisorscalerankMapper.selectOne(new LambdaQueryWrapper<MfAdvisorscalerank>()
.eq(MfAdvisorscalerank::getInvestadvisorcode, userInfoNew.getBelongOrgId())
.last("limit 1"));
userInfoNew.setFundNumber(ObjectUtils.anyNotNull(mfAdvisorscalerank) ? mfAdvisorscalerank.getTotalfundn() : null);
//设置成立时间 和 备案编号(公募没有备案编号)
MfInvestadvisoroutline mfInvestadvisoroutline = mfInvestadvisoroutlineMapper.selectOne(new LambdaQueryWrapper<MfInvestadvisoroutline>()
.eq(MfInvestadvisoroutline::getInvestadvisorcode, userInfoNew.getBelongOrgId())
.last("limit 1"));
userInfoNew.setFounded(ObjectUtils.anyNotNull(mfInvestadvisoroutline) ? mfInvestadvisoroutline.getEstablishmentdate().getTime() : null);
}
if(1 == userInfoNew.getBelongOrgType() && StringUtils.isNotBlank(userInfoNew.getBelongOrgId())){ // 私募
//设置 基金数
Integer integer = fundInfoMapper.selectCount(new LambdaQueryWrapper<FundInfo>().eq(FundInfo::getTrustId, userInfoNew.getBelongOrgId()));
userInfoNew.setFundNumber(integer);
//设置成立时间 和 备案编号
CompanyInfo companyInfo = companyInfoMapper.selectById(userInfoNew.getBelongOrgId());
if (ObjectUtils.anyNotNull(companyInfo)) {
userInfoNew.setFounded(companyInfo.getEstablishDate().getTime());
userInfoNew.setRecordNumber(companyInfo.getRegisterNumber());
}
}
//设置团队成员
CommonResp<List<UserInfoOrg>> usetInfoByOrgUserId = feignClientForFatools.getUsetInfoByOrgUserId(userId);
if (usetInfoByOrgUserId.isSuccess()){
List<UserInfoOrg> userInfoOrgs = usetInfoByOrgUserId.getData();
// 设置关注列表
List<String> collect = userInfoOrgs.stream().map(UserInfoOrg::getUserId).collect(Collectors.toList());
List<FollowRelEntity> followRelEntities = followRelMapper.selectList(new LambdaQueryWrapper<FollowRelEntity>()
.eq(FollowRelEntity::getFollowerId, userId)
.in(FollowRelEntity::getFollowUserId, collect)
.eq(FollowRelEntity::getDeleteTag, BizStatus.DeleteTag.tag_init));
Map<String, FollowRelEntity> collect1 = followRelEntities.stream().collect(Collectors.toMap(FollowRelEntity::getFollowUserId, Function.identity()));
userInfoOrgs.forEach(userInfoOrg -> {
if (collect1.containsKey(userInfoOrg.getUserId())) userInfoOrg.setIsFollower(1);
});
userInfoNew.setUserInfoOrgList(userInfoOrgs);
}
} else {
//普通主页
userInfoNew.setPersonalCenterType(1);
//设置课程数
CommonResp<Integer> integerCommonResp = feignClientForTanpuroom.myOrderCount(userId);
if (integerCommonResp.isSuccess()) userInfoNew.setCourseNumber(integerCommonResp.getData());
}
return userInfoNew;
}
private void getFansNUmAndFollowNum(UserInfoNew userInfoNew) {
Integer followNumber = followRelMapper.selectCount(new LambdaQueryWrapper<FollowRelEntity>().eq(FollowRelEntity::getFollowUserId, userInfoNew.getUserId())
.eq(FollowRelEntity::getDeleteTag, BizStatus.DeleteTag.tag_init));
Integer fansNumber = followRelMapper.selectCount(new LambdaQueryWrapper<FollowRelEntity>().eq(FollowRelEntity::getFollowerId, userInfoNew.getUserId())
.eq(FollowRelEntity::getDeleteTag, BizStatus.DeleteTag.tag_init));
userInfoNew.setFollowNumber(followNumber);
userInfoNew.setFansNumber(fansNumber);
}
public List<Customer> queryUserCustomerList(String userId) {
CommonResp<List<Customer>> ifaCustomerList = feignClientForDiagnose.getIfaCustomerList(userId);
if (ifaCustomerList.isSuccess()) return ifaCustomerList.getData();
return new ArrayList<>();
}
//获取用户关注、粉丝列表 //获取用户关注、粉丝列表
...@@ -64,4 +209,7 @@ public class HomePageManager { ...@@ -64,4 +209,7 @@ public class HomePageManager {
followRelService.deleteFollowRel(req.getFollowUserId(), followerId); followRelService.deleteFollowRel(req.getFollowUserId(), followerId);
} }
} }
} }
...@@ -46,6 +46,22 @@ spring.datasource: ...@@ -46,6 +46,22 @@ spring.datasource:
maxActive: 2 maxActive: 2
minIdle: 2 minIdle: 2
initialSize: 2 initialSize: 2
jydb:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://tamper.mysql.polardb.rds.aliyuncs.com:3306/jydb?autoReconnect=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&useSSL=false
username: jydb
password: @juyuan123
maxActive: 2
minIdle: 2
initialSize: 2
fund:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://tamper.mysql.polardb.rds.aliyuncs.com:3306/tamp_fund?autoReconnect=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&useSSL=false
username: tamp
password: @imeng123
maxActive: 2
minIdle: 2
initialSize: 2
spring.redis: spring.redis:
host: 118.190.63.109 host: 118.190.63.109
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment