Commit 27a98eb2 authored by 张辰's avatar 张辰

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

# Conflicts:
#	community-api/src/main/java/com/tanpu/community/api/beans/qo/ThemeQo.java
#	community-service/src/main/java/com/tanpu/community/cache/RedisCache.java
#	community-service/src/main/java/com/tanpu/community/service/ThemeService.java
parents c36d9d45 c6557a6e
......@@ -10,7 +10,7 @@ public final class CommunityConstant {
public static final String PACKAGE_BASE = "com.tanpu.community";
public static final String OSS_PREFIX_URL ="https://tamp-sit.oss-cn-shanghai.aliyuncs.com/";
public static final String OSS_PREFIX_URL ="http://tamperfeodev.oss-cn-shanghai.aliyuncs.com/";
@Value("${aliyun.oss.bucketName}")
public String OSS_BUCKET_NAME;
......
package com.tanpu.community.api.beans.qo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class MyCommentThemeQo extends ThemeQo{
@ApiModelProperty(value = "评论内容")
private String comment;
}
package com.tanpu.community.api.beans.qo;
import io.swagger.annotations.ApiModelProperty;
public class ThemeAnalysDO {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "UUID")
private String themeId;
@ApiModelProperty(value = "标题")
private String title;
@ApiModelProperty(value = "类型")
private Integer themeType;
@ApiModelProperty(value = "文本内容")
private String content;
@ApiModelProperty(value = "作者id")
private String authorId;
@ApiModelProperty(value = "被转发的主题")
private String formerThemeId;
@ApiModelProperty(value = "所属的话题")
private String topicId;
@ApiModelProperty(value = "转发量")
private Integer forwardCount;
@ApiModelProperty(value = "评论量")
private Integer commentCount;
@ApiModelProperty(value = "点赞量")
private Integer likeCount;
@ApiModelProperty(value = "距今时间")
private Long timeTillNow;
}
......@@ -17,7 +17,7 @@ import java.util.List;
@NoArgsConstructor
public class ThemeContentQo {
@ApiModelProperty(value = "RelTypeEnum类型,8:文本,88:产品 3:直播 6:短视频 2:课程,9:图片 10:多图(讨论)")
@ApiModelProperty(value = "RelTypeEnum类型,108:文本,88:产品 3:直播 6:短视频 303:新版课程-视频,新版课程-音频,109:单图(长文) 110:多图(讨论)")
private String type;
@ApiModelProperty(value = "文本的值是内容,附件的值为id")
......
......@@ -51,11 +51,17 @@ public class ThemeQo implements Serializable {
@ApiModelProperty(value = "用户头像")
public String userImg;
@ApiModelProperty(value = "用户简介")
private String userIntroduction;
@ApiModelProperty(value = "当前用户是否关注该作者")
public boolean follow;
@ApiModelProperty(value = "作者认证")
public String authLabel;
private Integer authLabel;
@ApiModelProperty(value = "认证机构")
private String authOrg;
@ApiModelProperty(value = "发表时间")
public String upToNowTime;
......@@ -75,6 +81,9 @@ public class ThemeQo implements Serializable {
@ApiModelProperty(value = "当前用户是否转发")
public boolean hasForward;
@ApiModelProperty(value = "当前用户是否收藏")
private boolean hasCollect;
@ApiModelProperty(value = "图片九宫格")
public List<ImagesDTO> imgList;
......
......@@ -16,4 +16,18 @@ public class TopicHotQo {
@ApiModelProperty(value = "类型 1:热 2:新")
private Integer type;
@ApiModelProperty(value = "阅读量")
private Integer viewCount;
@ApiModelProperty(value = "讨论量")
private Integer disscussCount;
/**
* TODO 热度计算算法
* @return
*/
public Integer getRank(){
return this.viewCount+this.disscussCount*5;
}
}
package com.tanpu.community.api.beans.req;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
@Data
public class HomePageReq {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "头像url")
@NotEmpty(message = "头像不能为空")
private String headImg;
@ApiModelProperty(value = "昵称")
@NotEmpty(message = "用户昵称不能为空")
private String nickName;
@ApiModelProperty(value = "个人简介")
@NotEmpty(message = "个人简介不能为空")
private String introduction;
@ApiModelProperty(value = "性别")
private Integer sex;
@ApiModelProperty(value = "地址")
private String location;
}
......@@ -5,19 +5,15 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
@ApiModel(value = "评论查询")
@Data
public class QueryCommentReq {
@NotEmpty(message = "主题id不能为空")
@ApiModelProperty(value = "主题Id")
private String themeId;
@NotEmpty(message = "page不能为空")
@ApiModelProperty(value = "分页")
private Pageable page;
}
......@@ -15,4 +15,5 @@ public class ReportThemeReq {
private String reason;
}
package com.tanpu.community.api.beans.req.theme;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
public class ThemeSearchReq {
@ApiModelProperty(value = "搜索关键字")
private String keyword;
@ApiModelProperty(value = "当前浏览的最后一个themeId,可以为空")
private String lastId="";
@NotNull(message = "PageSize不能为空")
@ApiModelProperty(value = "页面大小")
private Integer pageSize;
}
......@@ -7,7 +7,7 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@ApiModel(value = "创建主题")
@ApiModel(value = "创建主题返回值")
@Data
@Builder
@NoArgsConstructor
......
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.resp;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@ApiModel(value = "文件上传返回")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class FileUploadResp {
@ApiModelProperty(value = "文件id")
private String fileId;
@ApiModelProperty(value = "文件url")
private String url;
@ApiModelProperty(value = "图片高度")
private Integer imgHeight;
@ApiModelProperty(value = "图片宽度")
private Integer imgWidth;
@ApiModelProperty(value = "类型:1:图片")
private Integer fileType;
@ApiModelProperty(value = "文件名称")
private String fileName;
@ApiModelProperty(value = "阿里云key")
private String fileOssKey;
@ApiModelProperty(value = "预签名url")
private String previewUrl;
}
......@@ -19,8 +19,7 @@ public class ImagesDTO {
@ApiModelProperty("关联id")
private String relId;
@ApiModelProperty("图片url")
private String remark;
@ApiModelProperty("图片宽度")
......
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;
}
......@@ -5,7 +5,8 @@ public enum ThemeTypeEnum {
DISCUSSION(1,"讨论无标题"),
LONG_TEXT(2,"长文有标题"),
FORWARD(3,"转发");
FORWARD(3,"转发"),
RES_COMMENT(4,"回复,仅回显数据使用");
private Integer code;
private String type;
......
......@@ -2,7 +2,8 @@ package com.tanpu.community.api.enums;
public enum VisitTypeEnum {
TOPIC_PAGE_VIEW(1,"进入话题页"),
THEME_PAGE_VIEW(2,"进入主题正文");
THEME_PAGE_VIEW(2,"进入主题正文"),
FOLLOW_THEME_VIEW(3,"查看关注主题");
private Integer code;
private String type;
......
package com.tanpu.community.controller;
import com.tanpu.common.api.CommonResp;
import com.tanpu.common.constant.ErrorCodeConstant;
import com.tanpu.common.exception.BizException;
import com.tanpu.community.dao.entity.community.FileRecordEntity;
import com.tanpu.community.api.beans.resp.FileUploadResp;
import com.tanpu.community.manager.FileManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.Date;
@RestController
@Slf4j
@RequestMapping(value = "/api/file")
......@@ -22,7 +18,7 @@ public class FileController {
@PostMapping("/uploadFile")
@ResponseBody
public CommonResp<FileRecordEntity> uploadToRemote(@RequestParam(value = "file") MultipartFile file) {
public CommonResp<FileUploadResp> uploadToRemote(@RequestParam(value = "file") MultipartFile file) {
return CommonResp.success(fileManager.uploadFile(file));
}
}
......@@ -5,11 +5,12 @@ import com.tanpu.common.auth.AuthLogin;
import com.tanpu.common.auth.UserHolder;
import com.tanpu.community.api.beans.qo.FollowQo;
import com.tanpu.community.api.beans.qo.ThemeQo;
import com.tanpu.community.api.beans.req.HomePageReq;
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.QueryRecordThemeReq;
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.ThemeManager;
import io.swagger.annotations.ApiOperation;
......@@ -35,15 +36,25 @@ public class HomePageController {
@Resource
private UserHolder userHolder;
@PostMapping(value = "/editInfo")
@ApiOperation("编辑圈子个人资料")
@ResponseBody
public CommonResp<String> editUserInfo(@Validated @RequestBody HomePageReq req){
String userId="liujm";
// homePageManager.editUserInfo(req,userId);
return CommonResp.success("修改成功");
// 用户信息查询 (供圈子服务调用)
@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")
@ApiOperation("查询关注/粉丝列表")
@ResponseBody
......@@ -71,13 +82,4 @@ public class HomePageController {
return CommonResp.success(themeManager.queryThemesByUser(req,userId));
}
// @PostMapping(value = "/commentThemeList")
// @ApiOperation("用户评论过的帖子列表")
// @ResponseBody
// public CommonResp<List<ThemeQo>> commentThemeList(@RequestBody QueryRecordThemeReq req){
// String userId="123";
//
// return CommonResp.success(themeManager.queryThemesByUser(req,userId));
// }
}
......@@ -30,10 +30,17 @@ public class MetricsController {
@ApiOperation("浏览主题")
@GetMapping("/view/theme")
public CommonResp pageViewTheme(@RequestParam String themeId){
visitSummaryManager.addThemePageView(themeId);
visitSummaryManager.addFollowThemeView(themeId);
return CommonResp.success();
}
@AuthLogin
@ApiOperation("浏览关注主题")
@GetMapping("/view/follow")
public CommonResp pageViewTheme(){
visitSummaryManager.addFollowThemeView();
return CommonResp.success();
}
}
......@@ -35,9 +35,6 @@ public class ThemeController {
@ResponseBody
public CommonResp<CreateThemeResp> publishTheme(@Validated @RequestBody CreateThemeReq req) {
String userId = userHolder.getUserId();
if(StringUtils.isEmpty(userId)){
throw new BizException("用户为空");
}
return CommonResp.success(themeManager.publishTheme(req, userId));
}
......@@ -54,6 +51,16 @@ public class ThemeController {
return CommonResp.success(result);
}
@AuthLogin
@ApiOperation("主题搜索")
@PostMapping(value = "/search")
@ResponseBody
public CommonResp<List<ThemeQo>> searchInterestList(@Validated @RequestBody ThemeSearchReq req) {
String userId = userHolder.getUserId();
List<ThemeQo> result = themeManager.searchThemes(req, userId);
return CommonResp.success(result);
}
@AuthLogin
@ApiOperation("主题正文")
@GetMapping(value = "/detail")
......@@ -68,10 +75,9 @@ public class ThemeController {
@ApiOperation("转发主题")
@PostMapping(value = "/forward")
@ResponseBody
public CommonResp forwardTheme(@Validated @RequestBody ForwardThemeReq forwardThemeReq) {
public CommonResp<CreateThemeResp> forwardTheme(@Validated @RequestBody ForwardThemeReq forwardThemeReq) {
String userId = userHolder.getUserId();
themeManager.forward(forwardThemeReq, userId);
return CommonResp.success();
return CommonResp.success(themeManager.forward(forwardThemeReq, userId));
}
@AuthLogin
......@@ -130,4 +136,13 @@ public class ThemeController {
return CommonResp.success();
}
@AuthLogin
@ApiOperation("关注主题更新数量")
@GetMapping(value = "/updateCount")
@ResponseBody
public CommonResp<Integer> updateCount() {
String userId = userHolder.getUserId();
return CommonResp.success(themeManager.getFollowUpdateCount(userId));
}
}
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);
}
}
......@@ -3,7 +3,6 @@ package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tanpu.community.api.CommunityConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -58,7 +57,7 @@ public class FileRecordEntity implements Serializable {
private String extInfo;
public String getUrl(){
return CommunityConstant.OSS_PREFIX_URL+ fileOssKey;
return getPreviewUrl().substring(0,getPreviewUrl().indexOf("?"));
}
......
......@@ -16,12 +16,12 @@ import java.time.LocalDateTime;
* </p>
*
* @author xudong
* @since 2021-07-07
* @since 2021-07-19
*/
@TableName("visit_summary")
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel(value="VisitSummaryEntity对象", description="浏览记录")
public class VisitSummaryEntity implements Serializable {
......@@ -42,18 +42,14 @@ public class VisitSummaryEntity implements Serializable {
@ApiModelProperty(value = "关联目标ID")
private String refId;
@ApiModelProperty(value = "关联目标类型")
@ApiModelProperty(value = "关联目标类型 1:进入话题页 2:进入主题正文 3、用户查看首页-关注")
private Integer refType;
@ApiModelProperty(value = "浏览时间 单位秒")
private Integer duration;
private String createBy;
private LocalDateTime createTime;
private String updateBy;
private LocalDateTime updateTime;
private Integer deleteTag;
......@@ -115,14 +111,6 @@ public class VisitSummaryEntity implements Serializable {
this.duration = duration;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public LocalDateTime getCreateTime() {
return createTime;
}
......@@ -131,14 +119,6 @@ public class VisitSummaryEntity implements Serializable {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public LocalDateTime getUpdateTime() {
return updateTime;
}
......@@ -165,9 +145,7 @@ public class VisitSummaryEntity implements Serializable {
", refId=" + refId +
", refType=" + refType +
", duration=" + duration +
", createBy=" + createBy +
", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime +
", deleteTag=" + deleteTag +
"}";
......
package com.tanpu.community.dao.entity.fund;
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-fund-CompanyInfo")
@Data
@Builder
@TableName(value = "company_info")
public class CompanyInfo implements Serializable {
@TableId(value = "id", type = IdType.INPUT)
@ApiModelProperty(value="")
private String id;
/**
* 公司id
*/
@TableField(value = "p_company_id")
@ApiModelProperty(value="公司id")
private String pCompanyId;
/**
* 公司中文全称
*/
@TableField(value = "company_name")
@ApiModelProperty(value="公司中文全称")
private String companyName;
/**
* 公司中文简称
*/
@TableField(value = "company_short_name")
@ApiModelProperty(value="公司中文简称")
private String companyShortName;
/**
* 基金管理人全称(英文)
*/
@TableField(value = "company_english_name")
@ApiModelProperty(value="基金管理人全称(英文)")
private String companyEnglishName;
/**
* 公司类型:1-私募证券投资、2-公募基金公司、3-银行、4-证券公司、5-信托公司、6-审计机构,7-法律顾问,8-投资顾问,9-行政管理人,10-上市公司,11-期货公司,12-基金公司子公司,13工作室,14-私募股权投资,15-证券公司子公司,16-期货公司子公司,17-私募创业投资,-1-私募其他投资
*/
@TableField(value = "company_type")
@ApiModelProperty(value="公司类型:1-私募证券投资、2-公募基金公司、3-银行、4-证券公司、5-信托公司、6-审计机构,7-法律顾问,8-投资顾问,9-行政管理人,10-上市公司,11-期货公司,12-基金公司子公司,13工作室,14-私募股权投资,15-证券公司子公司,16-期货公司子公司,17-私募创业投资,-1-私募其他投资")
private Integer companyType;
/**
* 组织机构代码
*/
@TableField(value = "organization_number")
@ApiModelProperty(value="组织机构代码")
private String organizationNumber;
/**
* 公司成立日期
*/
@TableField(value = "establish_date")
@ApiModelProperty(value="公司成立日期")
private Date establishDate;
/**
* 公司注册国家:1-中国大陆、2-香港、3-新加坡、4-开曼群岛、5-台湾、6-英属维尔京群岛BVI、-1-其他
*/
@TableField(value = "domicile_id")
@ApiModelProperty(value="公司注册国家:1-中国大陆、2-香港、3-新加坡、4-开曼群岛、5-台湾、6-英属维尔京群岛BVI、-1-其他")
private Integer domicileId;
/**
* 公司注册地址
*/
@TableField(value = "company_address")
@ApiModelProperty(value="公司注册地址")
private String companyAddress;
/**
* 办公地址
*/
@TableField(value = "company_address2")
@ApiModelProperty(value="办公地址")
private String companyAddress2;
/**
* 城市
*/
@TableField(value = "city")
@ApiModelProperty(value="城市")
private String city;
/**
* 省
*/
@TableField(value = "province")
@ApiModelProperty(value="省")
private String province;
/**
* 国家
*/
@TableField(value = "country")
@ApiModelProperty(value="国家")
private String country;
/**
* 注册城市
*/
@TableField(value = "reg_city")
@ApiModelProperty(value="注册城市")
private String regCity;
/**
* 注册省
*/
@TableField(value = "reg_province")
@ApiModelProperty(value="注册省")
private String regProvince;
/**
* 注册国家
*/
@TableField(value = "reg_country")
@ApiModelProperty(value="注册国家")
private String regCountry;
/**
* 联系电话
*/
@TableField(value = "contact_phone")
@ApiModelProperty(value="联系电话")
private String contactPhone;
/**
* 邮政编码
*/
@TableField(value = "post_code")
@ApiModelProperty(value="邮政编码")
private String postCode;
/**
* 传真
*/
@TableField(value = "fax")
@ApiModelProperty(value="传真")
private String fax;
/**
* 邮箱
*/
@TableField(value = "email")
@ApiModelProperty(value="邮箱")
private String email;
/**
* 公司网址
*/
@TableField(value = "website")
@ApiModelProperty(value="公司网址")
private String website;
/**
* 公司注册资本,<量纲:万元>
*/
@TableField(value = "registered_capital")
@ApiModelProperty(value="公司注册资本,<量纲:万元> ")
private BigDecimal registeredCapital;
/**
* 公司简介
*/
@TableField(value = "company_profile")
@ApiModelProperty(value="公司简介")
private String companyProfile;
/**
* 是否有海外基金,0-否,1-是,-1-其他
*/
@TableField(value = "offshore_fund")
@ApiModelProperty(value="是否有海外基金,0-否,1-是,-1-其他")
private Integer offshoreFund;
/**
* 投资理念
*/
@TableField(value = "philosopy")
@ApiModelProperty(value="投资理念")
private String philosopy;
/**
* 公司状态:1-运行;2-注销
*/
@TableField(value = "company_status")
@ApiModelProperty(value="公司状态:1-运行;2-注销")
private Integer companyStatus;
/**
* 公司注册资本货币单位:1-人民币,2-港币,3-美元,-1-其他
*/
@TableField(value = "base_currency_crc")
@ApiModelProperty(value="公司注册资本货币单位:1-人民币,2-港币,3-美元,-1-其他")
private Integer baseCurrencyCrc;
/**
* 备案编码
*/
@TableField(value = "register_number")
@ApiModelProperty(value="备案编码")
private String registerNumber;
/**
* 备案状态:0-未备案,1-备案注销,2-备案存续
*/
@TableField(value = "register_status")
@ApiModelProperty(value="备案状态:0-未备案,1-备案注销,2-备案存续")
private Integer registerStatus;
/**
* 备案日期
*/
@TableField(value = "register_date")
@ApiModelProperty(value="备案日期")
private Date registerDate;
/**
* 备案地址
*/
@TableField(value = "register_number_address")
@ApiModelProperty(value="备案地址")
private String registerNumberAddress;
/**
* 是否会员:1-是,0-否
*/
@TableField(value = "is_member")
@ApiModelProperty(value="是否会员:1-是,0-否")
private Byte isMember;
/**
* 入会时间
*/
@TableField(value = "join_date")
@ApiModelProperty(value="入会时间")
private Date joinDate;
/**
* 会员类型:1-普通会员、2-联席会员、3-观察会员、4-特别会员
*/
@TableField(value = "member_type")
@ApiModelProperty(value="会员类型:1-普通会员、2-联席会员、3-观察会员、4-特别会员")
private Integer memberType;
/**
* 管理基金主要类别(与中基协同步)
*/
@TableField(value = "fund_category_ori")
@ApiModelProperty(value="管理基金主要类别(与中基协同步)")
private String fundCategoryOri;
/**
* 业务类型
*/
@TableField(value = "business_type")
@ApiModelProperty(value="业务类型")
private String businessType;
/**
* 企业性质:1 中外合作企业 2中外合资企业 3内资企业 4境外机构 5外商独资企业 6政府机构
*/
@TableField(value = "nature_business_type")
@ApiModelProperty(value="企业性质:1 中外合作企业 2中外合资企业 3内资企业 4境外机构 5外商独资企业 6政府机构")
private Integer natureBusinessType;
/**
* 注册资本实缴比例
*/
@TableField(value = "capital_paid_rate")
@ApiModelProperty(value="注册资本实缴比例")
private BigDecimal capitalPaidRate;
/**
* 公司logo
*/
@TableField(value = "logo")
@ApiModelProperty(value="公司logo")
private String logo;
/**
* 公司是否在前台可见
*/
@TableField(value = "isvisible")
@ApiModelProperty(value="公司是否在前台可见")
private Integer isvisible;
/**
* 实缴资本(万元)(人民币)
*/
@TableField(value = "paid_capital")
@ApiModelProperty(value="实缴资本(万元)(人民币)")
private BigDecimal paidCapital;
/**
* 公司资产规模 1:0-1亿 2:1-10亿 3:10-20亿 4:20-50亿 5:50-100亿 6:100亿以上
*/
@TableField(value = "company_asset_size")
@ApiModelProperty(value="公司资产规模 1:0-1亿 2:1-10亿 3:10-20亿 4:20-50亿 5:50-100亿 6:100亿以上")
private Integer companyAssetSize;
/**
* 法人代表
*/
@TableField(value = "legal_representative")
@ApiModelProperty(value="法人代表")
private String legalRepresentative;
/**
* 法人代表履历
*/
@TableField(value = "representative_experience")
@ApiModelProperty(value="法人代表履历")
private String representativeExperience;
/**
* 是否认证 0:否 1:是
*/
@TableField(value = "is_qualify")
@ApiModelProperty(value="是否认证 0:否 1:是")
private Integer isQualify;
/**
* 法人从业资格获得方式
*/
@TableField(value = "get_qualify_method")
@ApiModelProperty(value="法人从业资格获得方式")
private String getQualifyMethod;
/**
* 员工人数
*/
@TableField(value = "employee_cnts")
@ApiModelProperty(value="员工人数")
private Integer employeeCnts;
/**
* 信信息
*/
@TableField(value = "integrity_info")
@ApiModelProperty(value="信信息")
private String integrityInfo;
/**
* 提示信息
*/
@TableField(value = "special_tips")
@ApiModelProperty(value="提示信息")
private String specialTips;
/**
* 协会网站链接
*/
@TableField(value = "amac_link")
@ApiModelProperty(value="协会网站链接")
private String amacLink;
/**
* 创建时间
*/
@TableField(value = "create_time")
@ApiModelProperty(value="创建时间")
private Date createTime;
/**
* 创建人
*/
@TableField(value = "create_by")
@ApiModelProperty(value="创建人")
private String createBy;
/**
* 修改时间
*/
@TableField(value = "update_time")
@ApiModelProperty(value="修改时间")
private Date updateTime;
/**
* 修改人
*/
@TableField(value = "update_by")
@ApiModelProperty(value="修改人")
private String updateBy;
/**
* 删除标识
*/
@TableField(value = "delete_tag")
@ApiModelProperty(value="删除标识")
private Integer deleteTag;
/**
* 机构ID
*/
@TableField(value = "org_id")
@ApiModelProperty(value="机构ID")
private String orgId;
private static final long serialVersionUID = 1L;
public static final String COL_ID = "id";
public static final String COL_P_COMPANY_ID = "p_company_id";
public static final String COL_COMPANY_NAME = "company_name";
public static final String COL_COMPANY_SHORT_NAME = "company_short_name";
public static final String COL_COMPANY_ENGLISH_NAME = "company_english_name";
public static final String COL_COMPANY_TYPE = "company_type";
public static final String COL_ORGANIZATION_NUMBER = "organization_number";
public static final String COL_ESTABLISH_DATE = "establish_date";
public static final String COL_DOMICILE_ID = "domicile_id";
public static final String COL_COMPANY_ADDRESS = "company_address";
public static final String COL_COMPANY_ADDRESS2 = "company_address2";
public static final String COL_CITY = "city";
public static final String COL_PROVINCE = "province";
public static final String COL_COUNTRY = "country";
public static final String COL_REG_CITY = "reg_city";
public static final String COL_REG_PROVINCE = "reg_province";
public static final String COL_REG_COUNTRY = "reg_country";
public static final String COL_CONTACT_PHONE = "contact_phone";
public static final String COL_POST_CODE = "post_code";
public static final String COL_FAX = "fax";
public static final String COL_EMAIL = "email";
public static final String COL_WEBSITE = "website";
public static final String COL_REGISTERED_CAPITAL = "registered_capital";
public static final String COL_COMPANY_PROFILE = "company_profile";
public static final String COL_OFFSHORE_FUND = "offshore_fund";
public static final String COL_PHILOSOPY = "philosopy";
public static final String COL_COMPANY_STATUS = "company_status";
public static final String COL_BASE_CURRENCY_CRC = "base_currency_crc";
public static final String COL_REGISTER_NUMBER = "register_number";
public static final String COL_REGISTER_STATUS = "register_status";
public static final String COL_REGISTER_DATE = "register_date";
public static final String COL_REGISTER_NUMBER_ADDRESS = "register_number_address";
public static final String COL_IS_MEMBER = "is_member";
public static final String COL_JOIN_DATE = "join_date";
public static final String COL_MEMBER_TYPE = "member_type";
public static final String COL_FUND_CATEGORY_ORI = "fund_category_ori";
public static final String COL_BUSINESS_TYPE = "business_type";
public static final String COL_NATURE_BUSINESS_TYPE = "nature_business_type";
public static final String COL_CAPITAL_PAID_RATE = "capital_paid_rate";
public static final String COL_LOGO = "logo";
public static final String COL_ISVISIBLE = "isvisible";
public static final String COL_PAID_CAPITAL = "paid_capital";
public static final String COL_COMPANY_ASSET_SIZE = "company_asset_size";
public static final String COL_LEGAL_REPRESENTATIVE = "legal_representative";
public static final String COL_REPRESENTATIVE_EXPERIENCE = "representative_experience";
public static final String COL_IS_QUALIFY = "is_qualify";
public static final String COL_GET_QUALIFY_METHOD = "get_qualify_method";
public static final String COL_EMPLOYEE_CNTS = "employee_cnts";
public static final String COL_INTEGRITY_INFO = "integrity_info";
public static final String COL_SPECIAL_TIPS = "special_tips";
public static final String COL_AMAC_LINK = "amac_link";
public static final String COL_CREATE_TIME = "create_time";
public static final String COL_CREATE_BY = "create_by";
public static final String COL_UPDATE_TIME = "update_time";
public static final String COL_UPDATE_BY = "update_by";
public static final String COL_DELETE_TAG = "delete_tag";
public static final String COL_ORG_ID = "org_id";
}
\ No newline at end of file
package com.tanpu.community.dao.entity.fund;
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.util.Date;
import lombok.Builder;
import lombok.Data;
/**
* 基金基本信息
*/
@ApiModel(value="com-tanpu-community-dao-entity-fund-FundInfo")
@Data
@Builder
@TableName(value = "fund_info")
public class FundInfo implements Serializable {
/**
* 基金id
*/
@TableId(value = "id", type = IdType.INPUT)
@ApiModelProperty(value="基金id")
private String id;
/**
* 父级产品ID
*/
@TableField(value = "p_fund_id")
@ApiModelProperty(value="父级产品ID")
private String pFundId;
/**
* 基金中文全称
*/
@TableField(value = "fund_name")
@ApiModelProperty(value="基金中文全称")
private String fundName;
/**
* 基金中文简称
*/
@TableField(value = "fund_short_name")
@ApiModelProperty(value="基金中文简称")
private String fundShortName;
/**
* 基金形式:1-公司型,2-合伙型,3-契约型,-1-其他
*/
@TableField(value = "fund_structure")
@ApiModelProperty(value="基金形式:1-公司型,2-合伙型,3-契约型,-1-其他")
private Integer fundStructure;
/**
* 私募基金类型:1-信托计划,2-有限合伙,3-券商资管,4-公募专户,5-单账户,6-证券投资基金,7-海外基金,8-期货资管,9-保险资管、10-创业投资基金、11-股权投资基金、12-银行理财、13-类固收信托、-1其他投资基金
公募基金类型:1-混合型、2-债券型、3-定开债券、4-联接基金、5-货币型、6-债券指数、7-保本型、8-理财型、9-QDII、10-股票指数、11-QDII-指数、12-股票型、13-固定收益、14-分级杠杆、15-ETF-场内、16-QDII-ETF、17-债券创新-场内、18-封闭式
*/
@TableField(value = "fund_type")
@ApiModelProperty(value="私募基金类型:1-信托计划,2-有限合伙,3-券商资管,4-公募专户,5-单账户,6-证券投资基金,7-海外基金,8-期货资管,9-保险资管、10-创业投资基金、11-股权投资基金、12-银行理财、13-类固收信托、-1其他投资基金 ,公募基金类型:1-混合型、2-债券型、3-定开债券、4-联接基金、5-货币型、6-债券指数、7-保本型、8-理财型、9-QDII、10-股票指数、11-QDII-指数、12-股票型、13-固定收益、14-分级杠杆、15-ETF-场内、16-QDII-ETF、17-债券创新-场内、18-封闭式")
private Integer fundType;
/**
* 是否可预约 0:不可预约 1:可预约
*/
@TableField(value = "`type`")
@ApiModelProperty(value="是否可预约 0:不可预约 1:可预约")
private Integer type;
/**
* 募集方式:1-私募,2-公募
*/
@TableField(value = "raise_type")
@ApiModelProperty(value="募集方式:1-私募,2-公募")
private Integer raiseType;
/**
* 券商资管产品特点
*/
@TableField(value = "fund_characteristic")
@ApiModelProperty(value="券商资管产品特点")
private String fundCharacteristic;
/**
* 基础货币,1-人民币,2-港币,3-美元,4-份,-1-其他
*/
@TableField(value = "base_currency")
@ApiModelProperty(value="基础货币,1-人民币,2-港币,3-美元,4-份,-1-其他")
private Integer baseCurrency;
/**
* 成立日期
*/
@TableField(value = "inception_date")
@ApiModelProperty(value="成立日期")
private Date inceptionDate;
/**
* 注册国家,1-中国大陆、2-香港、3-新加坡、4-开曼群岛、5-台湾、6-英属维尔京群岛BVI、-1-其他
*/
@TableField(value = "domicile")
@ApiModelProperty(value="注册国家,1-中国大陆、2-香港、3-新加坡、4-开曼群岛、5-台湾、6-英属维尔京群岛BVI、-1-其他")
private Integer domicile;
/**
* 指数id,以'IN'开头(后加36进制编码格式,不足8位长度左补零) 例:IN00000001
*/
@TableField(value = "primary_benchmark_id")
@ApiModelProperty(value="指数id,以'IN'开头(后加36进制编码格式,不足8位长度左补零) 例:IN00000001")
private String primaryBenchmarkId;
/**
* 封闭期,单位:月,-1:不确定,0:无封闭期
*/
@TableField(value = "lockup_period")
@ApiModelProperty(value="封闭期,单位:月,-1:不确定,0:无封闭期")
private Integer lockupPeriod;
/**
* 开放日
*/
@TableField(value = "open_day")
@ApiModelProperty(value="开放日")
private String openDay;
/**
* 产品存续期,单位:月。-1,不确定,0,无固定期限,999999永续
*/
@TableField(value = "duration")
@ApiModelProperty(value="产品存续期,单位:月。-1,不确定,0,无固定期限,999999永续")
private Integer duration;
/**
* 基金投资范围
*/
@TableField(value = "investment_scope")
@ApiModelProperty(value="基金投资范围")
private String investmentScope;
/**
* 投资限制
*/
@TableField(value = "investment_restriction")
@ApiModelProperty(value="投资限制")
private String investmentRestriction;
/**
* 投资理念
*/
@TableField(value = "fund_investment_philosophy")
@ApiModelProperty(value="投资理念")
private String fundInvestmentPhilosophy;
/**
* 投资策略
*/
@TableField(value = "fund_strategy_description")
@ApiModelProperty(value="投资策略")
private String fundStrategyDescription;
/**
* 投资顾问id
*/
@TableField(value = "advisor_id")
@ApiModelProperty(value="投资顾问id")
private String advisorId;
/**
* 托管银行Id
*/
@TableField(value = "custodian_id")
@ApiModelProperty(value="托管银行Id")
private String custodianId;
/**
* 证券经纪人Id
*/
@TableField(value = "broker_id")
@ApiModelProperty(value="证券经纪人Id")
private String brokerId;
/**
* 期货经纪人id
*/
@TableField(value = "broker_future_id")
@ApiModelProperty(value="期货经纪人id")
private String brokerFutureId;
/**
* 外包机构Id
*/
@TableField(value = "liquidation_agency_id")
@ApiModelProperty(value="外包机构Id")
private String liquidationAgencyId;
/**
* 基金管理公司Id
*/
@TableField(value = "trust_id")
@ApiModelProperty(value="基金管理公司Id")
private String trustId;
/**
* 投资顾问Id
*/
@TableField(value = "investment_consultant_id")
@ApiModelProperty(value="投资顾问Id")
private String investmentConsultantId;
/**
* 行政管理人Id
*/
@TableField(value = "administrator_id")
@ApiModelProperty(value="行政管理人Id")
private String administratorId;
/**
* 法律顾问Id
*/
@TableField(value = "legal_counsel_id")
@ApiModelProperty(value="法律顾问Id")
private String legalCounselId;
/**
* 审计机构
*/
@TableField(value = "auditor_id")
@ApiModelProperty(value="审计机构")
private String auditorId;
/**
* 净值披露频率 1:天 2:周 3:月 4:半月 5:季度
*/
@TableField(value = "nav_frequency")
@ApiModelProperty(value="净值披露频率 1:天 2:周 3:月 4:半月 5:季度")
private Integer navFrequency;
/**
* 产品业绩披露标识:1-AAA,2-AA,3-A,4-A-,5-A+
*/
@TableField(value = "performance_disclosure_mark")
@ApiModelProperty(value="产品业绩披露标识:1-AAA,2-AA,3-A,4-A-,5-A+")
private Integer performanceDisclosureMark;
/**
* 备案编码
*/
@TableField(value = "register_number")
@ApiModelProperty(value="备案编码")
private String registerNumber;
/**
* 备案日期
*/
@TableField(value = "register_date")
@ApiModelProperty(value="备案日期")
private Date registerDate;
/**
* 基金在前台是否可见:1-可见 0-不可见
*/
@TableField(value = "isvisible")
@ApiModelProperty(value="基金在前台是否可见:1-可见 0-不可见")
private Integer isvisible;
/**
* 是否分级:1-分级,0-不分级;
*/
@TableField(value = "istiered")
@ApiModelProperty(value="是否分级:1-分级,0-不分级;")
private Integer istiered;
/**
* 是否参与排名,1-参与排名 0-不参与排名
*/
@TableField(value = "is_ranking")
@ApiModelProperty(value="是否参与排名,1-参与排名 0-不参与排名 ")
private Integer isRanking;
/**
* 是否参与评级,1-参与评级 0-不参与评级
*/
@TableField(value = "is_rating")
@ApiModelProperty(value="是否参与评级,1-参与评级 0-不参与评级 ")
private Integer isRating;
/**
* 基金协会特别提示
*/
@TableField(value = "special_tips")
@ApiModelProperty(value="基金协会特别提示")
private String specialTips;
/**
* 基金协会链接
*/
@TableField(value = "amac_url")
@ApiModelProperty(value="基金协会链接")
private String amacUrl;
/**
* 净值来源说明:1-托管外包、2-信托券商官网、3-私募机构
*/
@TableField(value = "nav_source_type")
@ApiModelProperty(value="净值来源说明:1-托管外包、2-信托券商官网、3-私募机构")
private Integer navSourceType;
/**
* 组合目标
*/
@TableField(value = "combine_target")
@ApiModelProperty(value="组合目标")
private String combineTarget;
/**
* 适合群体
*/
@TableField(value = "fit_group")
@ApiModelProperty(value="适合群体")
private String fitGroup;
/**
* 组合点评
*/
@TableField(value = "combine_comment")
@ApiModelProperty(value="组合点评")
private String combineComment;
/**
* 调仓点评
*/
@TableField(value = "transfer_comment")
@ApiModelProperty(value="调仓点评")
private String transferComment;
/**
* 基金描述
*/
@TableField(value = "desc_info")
@ApiModelProperty(value="基金描述")
private String descInfo;
/**
* 融智策略分类,1-股票策略,2-宏观策略,3-管理期货,4-事件驱动,5-相对价值策略,6-固定收益策略,7-组合基金,8-复合策略,-1-其它策略
*/
@TableField(value = "strategy")
@ApiModelProperty(value="融智策略分类,1-股票策略,2-宏观策略,3-管理期货,4-事件驱动,5-相对价值策略,6-固定收益策略,7-组合基金,8-复合策略,-1-其它策略")
private Integer strategy;
/**
* 融智子策略分类:1010-主观多头 1020-股票多空 1030-量化多头 2010-宏观策略 3010-主观趋势 3020-主观套利 3030-量化趋势 3040-量化套利 3050-管理期货复合 4010-并购重组 4020-定向增发 4030-大宗交易 4040-事件驱动复合 5010-股票市场中性 5020-套利 5030-相对价值复合 6010-纯债策略 6020-强债策略 6030-固收复合 7010-MOM 7020-FOF 8010-主观多策略 8020-量化多策略 -1-其他策略'
*/
@TableField(value = "substrategy")
@ApiModelProperty(value="融智子策略分类:1010-主观多头 1020-股票多空 1030-量化多头 2010-宏观策略 3010-主观趋势 3020-主观套利 3030-量化趋势 3040-量化套利 3050-管理期货复合 4010-并购重组 4020-定向增发 4030-大宗交易 4040-事件驱动复合 5010-股票市场中性 5020-套利 5030-相对价值复合 6010-纯债策略 6020-强债策略 6030-固收复合 7010-MOM 7020-FOF 8010-主观多策略 8020-量化多策略 -1-其他策略'")
private Integer substrategy;
@TableField(value = "has_nav")
@ApiModelProperty(value="")
private Integer hasNav;
/**
* 风险等级
*/
@TableField(value = "risk_level")
@ApiModelProperty(value="风险等级")
private Integer riskLevel;
@TableField(value = "create_by")
@ApiModelProperty(value="")
private String createBy;
@TableField(value = "create_time")
@ApiModelProperty(value="")
private Date createTime;
@TableField(value = "update_by")
@ApiModelProperty(value="")
private String updateBy;
@TableField(value = "update_time")
@ApiModelProperty(value="")
private Date updateTime;
/**
* 数据来源 1:tanpu,2:私募排排
*/
@TableField(value = "data_sources")
@ApiModelProperty(value="数据来源 1:tanpu,2:私募排排")
private Integer dataSources;
/**
* 0:待上架 1:已上架 2:已下架
*/
@TableField(value = "`status`")
@ApiModelProperty(value="0:待上架 1:已上架 2:已下架")
private Integer status;
/**
* 删除标识 0:否 1:是
*/
@TableField(value = "delete_tag")
@ApiModelProperty(value="删除标识 0:否 1:是")
private Integer deleteTag;
/**
* 排序
*/
@TableField(value = "sort")
@ApiModelProperty(value="排序")
private Integer sort;
@TableField(value = "apply_day")
@ApiModelProperty(value="")
private String applyDay;
@TableField(value = "redeem_day")
@ApiModelProperty(value="")
private String redeemDay;
/**
* 机构ID
*/
@TableField(value = "org_id")
@ApiModelProperty(value="机构ID")
private String orgId;
private static final long serialVersionUID = 1L;
public static final String COL_ID = "id";
public static final String COL_P_FUND_ID = "p_fund_id";
public static final String COL_FUND_NAME = "fund_name";
public static final String COL_FUND_SHORT_NAME = "fund_short_name";
public static final String COL_FUND_STRUCTURE = "fund_structure";
public static final String COL_FUND_TYPE = "fund_type";
public static final String COL_TYPE = "type";
public static final String COL_RAISE_TYPE = "raise_type";
public static final String COL_FUND_CHARACTERISTIC = "fund_characteristic";
public static final String COL_BASE_CURRENCY = "base_currency";
public static final String COL_INCEPTION_DATE = "inception_date";
public static final String COL_DOMICILE = "domicile";
public static final String COL_PRIMARY_BENCHMARK_ID = "primary_benchmark_id";
public static final String COL_LOCKUP_PERIOD = "lockup_period";
public static final String COL_OPEN_DAY = "open_day";
public static final String COL_DURATION = "duration";
public static final String COL_INVESTMENT_SCOPE = "investment_scope";
public static final String COL_INVESTMENT_RESTRICTION = "investment_restriction";
public static final String COL_FUND_INVESTMENT_PHILOSOPHY = "fund_investment_philosophy";
public static final String COL_FUND_STRATEGY_DESCRIPTION = "fund_strategy_description";
public static final String COL_ADVISOR_ID = "advisor_id";
public static final String COL_CUSTODIAN_ID = "custodian_id";
public static final String COL_BROKER_ID = "broker_id";
public static final String COL_BROKER_FUTURE_ID = "broker_future_id";
public static final String COL_LIQUIDATION_AGENCY_ID = "liquidation_agency_id";
public static final String COL_TRUST_ID = "trust_id";
public static final String COL_INVESTMENT_CONSULTANT_ID = "investment_consultant_id";
public static final String COL_ADMINISTRATOR_ID = "administrator_id";
public static final String COL_LEGAL_COUNSEL_ID = "legal_counsel_id";
public static final String COL_AUDITOR_ID = "auditor_id";
public static final String COL_NAV_FREQUENCY = "nav_frequency";
public static final String COL_PERFORMANCE_DISCLOSURE_MARK = "performance_disclosure_mark";
public static final String COL_REGISTER_NUMBER = "register_number";
public static final String COL_REGISTER_DATE = "register_date";
public static final String COL_ISVISIBLE = "isvisible";
public static final String COL_ISTIERED = "istiered";
public static final String COL_IS_RANKING = "is_ranking";
public static final String COL_IS_RATING = "is_rating";
public static final String COL_SPECIAL_TIPS = "special_tips";
public static final String COL_AMAC_URL = "amac_url";
public static final String COL_NAV_SOURCE_TYPE = "nav_source_type";
public static final String COL_COMBINE_TARGET = "combine_target";
public static final String COL_FIT_GROUP = "fit_group";
public static final String COL_COMBINE_COMMENT = "combine_comment";
public static final String COL_TRANSFER_COMMENT = "transfer_comment";
public static final String COL_DESC_INFO = "desc_info";
public static final String COL_STRATEGY = "strategy";
public static final String COL_SUBSTRATEGY = "substrategy";
public static final String COL_HAS_NAV = "has_nav";
public static final String COL_RISK_LEVEL = "risk_level";
public static final String COL_CREATE_BY = "create_by";
public static final String COL_CREATE_TIME = "create_time";
public static final String COL_UPDATE_BY = "update_by";
public static final String COL_UPDATE_TIME = "update_time";
public static final String COL_DATA_SOURCES = "data_sources";
public static final String COL_STATUS = "status";
public static final String COL_DELETE_TAG = "delete_tag";
public static final String COL_SORT = "sort";
public static final String COL_APPLY_DAY = "apply_day";
public static final String COL_REDEEM_DAY = "redeem_day";
public static final String COL_ORG_ID = "org_id";
}
\ No newline at end of file
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-MfAdvisorscalerank")
@Data
@Builder
@TableName(value = "mf_advisorscalerank")
public class MfAdvisorscalerank implements Serializable {
/**
* ID
*/
@TableField(value = "ID")
@ApiModelProperty(value="ID")
private Long id;
/**
* 基金管理人编码
*/
@TableField(value = "InvestAdvisorCode")
@ApiModelProperty(value="基金管理人编码")
private Integer investadvisorcode;
/**
* 截止日期
*/
@TableField(value = "EndDate")
@ApiModelProperty(value="截止日期")
private Date enddate;
/**
* 总管理规模(亿元)
*/
@TableField(value = "TotalFundNV")
@ApiModelProperty(value="总管理规模(亿元)")
private BigDecimal totalfundnv;
/**
* 旗下基金总数(只)
*/
@TableField(value = "TotalFundN")
@ApiModelProperty(value="旗下基金总数(只)")
private Integer totalfundn;
/**
* 股票型管理规模(亿元)
*/
@TableField(value = "EquityFundNV")
@ApiModelProperty(value="股票型管理规模(亿元)")
private BigDecimal equityfundnv;
/**
* 股票型基金管理规模排名
*/
@TableField(value = "EquityNVRank")
@ApiModelProperty(value="股票型基金管理规模排名")
private Integer equitynvrank;
/**
* 股票型基金数量(只)
*/
@TableField(value = "EquityFundN")
@ApiModelProperty(value="股票型基金数量(只)")
private Integer equityfundn;
/**
* 股票型基金管理数量排名
*/
@TableField(value = "EquityNRank")
@ApiModelProperty(value="股票型基金管理数量排名")
private Integer equitynrank;
/**
* 管理股票型基金公司数
*/
@TableField(value = "AdvisorOfEquity")
@ApiModelProperty(value="管理股票型基金公司数")
private Integer advisorofequity;
/**
* 混合型管理规模(亿元)
*/
@TableField(value = "HybridFundNV")
@ApiModelProperty(value="混合型管理规模(亿元)")
private BigDecimal hybridfundnv;
/**
* 混合型基金管理规模排名
*/
@TableField(value = "HybridNVRank")
@ApiModelProperty(value="混合型基金管理规模排名")
private Integer hybridnvrank;
/**
* 混合型基金数量(只)
*/
@TableField(value = "HybridFundN")
@ApiModelProperty(value="混合型基金数量(只)")
private Integer hybridfundn;
/**
* 混合型基金管理数量排名
*/
@TableField(value = "HybridNRank")
@ApiModelProperty(value="混合型基金管理数量排名")
private Integer hybridnrank;
/**
* 管理混合型基金公司数
*/
@TableField(value = "AdvisorOfHybrid")
@ApiModelProperty(value="管理混合型基金公司数")
private Integer advisorofhybrid;
/**
* 债券型管理规模(亿元)
*/
@TableField(value = "BondFundNV")
@ApiModelProperty(value="债券型管理规模(亿元)")
private BigDecimal bondfundnv;
/**
* 债券型基金管理规模排名
*/
@TableField(value = "BondNVRank")
@ApiModelProperty(value="债券型基金管理规模排名")
private Integer bondnvrank;
/**
* 债券型基金数量(只)
*/
@TableField(value = "BondFundN")
@ApiModelProperty(value="债券型基金数量(只)")
private Integer bondfundn;
/**
* 债券型基金管理数量排名
*/
@TableField(value = "BondNRank")
@ApiModelProperty(value="债券型基金管理数量排名")
private Integer bondnrank;
/**
* 管理债券型基金公司数
*/
@TableField(value = "AdvisorOfBond")
@ApiModelProperty(value="管理债券型基金公司数")
private Integer advisorofbond;
/**
* 货币型管理规模(亿元)
*/
@TableField(value = "MonetaryFundNV")
@ApiModelProperty(value="货币型管理规模(亿元)")
private BigDecimal monetaryfundnv;
/**
* 货币型基金管理规模排名
*/
@TableField(value = "MonetaryNVRank")
@ApiModelProperty(value="货币型基金管理规模排名")
private Integer monetarynvrank;
/**
* 货币型基金数量(只)
*/
@TableField(value = "MonetaryFundN")
@ApiModelProperty(value="货币型基金数量(只)")
private Integer monetaryfundn;
/**
* 货币型基金管理数量排名
*/
@TableField(value = "MonetaryNRank")
@ApiModelProperty(value="货币型基金管理数量排名")
private Integer monetarynrank;
/**
* 管理货币型基金公司数
*/
@TableField(value = "AdvisorOfMonetary")
@ApiModelProperty(value="管理货币型基金公司数")
private Integer advisorofmonetary;
/**
* 理财型管理规模(亿元)
*/
@TableField(value = "ShortBondFundNV")
@ApiModelProperty(value="理财型管理规模(亿元)")
private BigDecimal shortbondfundnv;
/**
* 理财型基金管理规模排名
*/
@TableField(value = "ShortBondNVRank")
@ApiModelProperty(value="理财型基金管理规模排名")
private Integer shortbondnvrank;
/**
* 理财型基金数量(只)
*/
@TableField(value = "ShortBondFundN")
@ApiModelProperty(value="理财型基金数量(只)")
private Integer shortbondfundn;
/**
* 理财型基金管理数量排名
*/
@TableField(value = "ShortBondNRank")
@ApiModelProperty(value="理财型基金管理数量排名")
private Integer shortbondnrank;
/**
* 管理理财型基金公司数
*/
@TableField(value = "AdvisorOfShortBond")
@ApiModelProperty(value="管理理财型基金公司数")
private Integer advisorofshortbond;
/**
* QDII管理规模(亿元)
*/
@TableField(value = "QDIINV")
@ApiModelProperty(value="QDII管理规模(亿元)")
private BigDecimal qdiinv;
/**
* QDII基金管理规模排名
*/
@TableField(value = "QDIINVRank")
@ApiModelProperty(value="QDII基金管理规模排名")
private Integer qdiinvrank;
/**
* QDII基金数量(只)
*/
@TableField(value = "QDIIN")
@ApiModelProperty(value="QDII基金数量(只)")
private Integer qdiin;
/**
* QDII基金管理数量排名
*/
@TableField(value = "QDIINRank")
@ApiModelProperty(value="QDII基金管理数量排名")
private Integer qdiinrank;
/**
* 管理QDII基金公司数
*/
@TableField(value = "AdvisorOfQDII")
@ApiModelProperty(value="管理QDII基金公司数")
private Integer advisorofqdii;
/**
* 发布时间
*/
@TableField(value = "InsertTime")
@ApiModelProperty(value="发布时间")
private Date inserttime;
/**
* 更新时间
*/
@TableField(value = "UpdateTime")
@ApiModelProperty(value="更新时间")
private Date updatetime;
/**
* JSID
*/
@TableField(value = "JSID")
@ApiModelProperty(value="JSID")
private Long jsid;
/**
* 总管理规模排名
*/
@TableField(value = "FundNVRank")
@ApiModelProperty(value="总管理规模排名")
private Integer fundnvrank;
/**
* 添加列FundNRank
*/
@TableField(value = "FundNRank")
@ApiModelProperty(value="添加列FundNRank")
private Integer fundnrank;
/**
* 基金公司总数
*/
@TableField(value = "TotalAdvisor")
@ApiModelProperty(value="基金公司总数")
private Integer totaladvisor;
/**
* 非货基与理财债基管理规模(亿元)
*/
@TableField(value = "UnMSBFNV")
@ApiModelProperty(value="非货基与理财债基管理规模(亿元)")
private BigDecimal unmsbfnv;
/**
* 非货基与理财债基管理规模排名
*/
@TableField(value = "UnMSBFNVRank")
@ApiModelProperty(value="非货基与理财债基管理规模排名")
private Integer unmsbfnvrank;
/**
* 非货基与理财债基数量(只)
*/
@TableField(value = "UnMSBFN")
@ApiModelProperty(value="非货基与理财债基数量(只)")
private Integer unmsbfn;
/**
* 非货基与理财债基管理数量排名
*/
@TableField(value = "UnMSBFNRank")
@ApiModelProperty(value="非货基与理财债基管理数量排名")
private Integer unmsbfnrank;
/**
* 管理非货基与理财债基公司数
*/
@TableField(value = "AdvisorOfUnMSBF")
@ApiModelProperty(value="管理非货基与理财债基公司数")
private Integer advisorofunmsbf;
/**
* 主动权益类基金管理规模(亿元)
*/
@TableField(value = "ActiveEFNV")
@ApiModelProperty(value="主动权益类基金管理规模(亿元)")
private BigDecimal activeefnv;
/**
* 主动权益类基金管理规模排名
*/
@TableField(value = "ActiveEFNVRank")
@ApiModelProperty(value="主动权益类基金管理规模排名")
private Integer activeefnvrank;
/**
* 主动权益类基金数量(只)
*/
@TableField(value = "ActiveEFN")
@ApiModelProperty(value="主动权益类基金数量(只)")
private Integer activeefn;
/**
* 主动权益类基金管理数量排名
*/
@TableField(value = "ActiveEFNRank")
@ApiModelProperty(value="主动权益类基金管理数量排名")
private Integer activeefnrank;
/**
* 管理主动权益类基金公司数
*/
@TableField(value = "AdvisorOfActiveEF")
@ApiModelProperty(value="管理主动权益类基金公司数")
private Integer advisorofactiveef;
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_ENDDATE = "EndDate";
public static final String COL_TOTALFUNDNV = "TotalFundNV";
public static final String COL_TOTALFUNDN = "TotalFundN";
public static final String COL_EQUITYFUNDNV = "EquityFundNV";
public static final String COL_EQUITYNVRANK = "EquityNVRank";
public static final String COL_EQUITYFUNDN = "EquityFundN";
public static final String COL_EQUITYNRANK = "EquityNRank";
public static final String COL_ADVISOROFEQUITY = "AdvisorOfEquity";
public static final String COL_HYBRIDFUNDNV = "HybridFundNV";
public static final String COL_HYBRIDNVRANK = "HybridNVRank";
public static final String COL_HYBRIDFUNDN = "HybridFundN";
public static final String COL_HYBRIDNRANK = "HybridNRank";
public static final String COL_ADVISOROFHYBRID = "AdvisorOfHybrid";
public static final String COL_BONDFUNDNV = "BondFundNV";
public static final String COL_BONDNVRANK = "BondNVRank";
public static final String COL_BONDFUNDN = "BondFundN";
public static final String COL_BONDNRANK = "BondNRank";
public static final String COL_ADVISOROFBOND = "AdvisorOfBond";
public static final String COL_MONETARYFUNDNV = "MonetaryFundNV";
public static final String COL_MONETARYNVRANK = "MonetaryNVRank";
public static final String COL_MONETARYFUNDN = "MonetaryFundN";
public static final String COL_MONETARYNRANK = "MonetaryNRank";
public static final String COL_ADVISOROFMONETARY = "AdvisorOfMonetary";
public static final String COL_SHORTBONDFUNDNV = "ShortBondFundNV";
public static final String COL_SHORTBONDNVRANK = "ShortBondNVRank";
public static final String COL_SHORTBONDFUNDN = "ShortBondFundN";
public static final String COL_SHORTBONDNRANK = "ShortBondNRank";
public static final String COL_ADVISOROFSHORTBOND = "AdvisorOfShortBond";
public static final String COL_QDIINV = "QDIINV";
public static final String COL_QDIINVRANK = "QDIINVRank";
public static final String COL_QDIIN = "QDIIN";
public static final String COL_QDIINRANK = "QDIINRank";
public static final String COL_ADVISOROFQDII = "AdvisorOfQDII";
public static final String COL_INSERTTIME = "InsertTime";
public static final String COL_UPDATETIME = "UpdateTime";
public static final String COL_JSID = "JSID";
public static final String COL_FUNDNVRANK = "FundNVRank";
public static final String COL_FUNDNRANK = "FundNRank";
public static final String COL_TOTALADVISOR = "TotalAdvisor";
public static final String COL_UNMSBFNV = "UnMSBFNV";
public static final String COL_UNMSBFNVRANK = "UnMSBFNVRank";
public static final String COL_UNMSBFN = "UnMSBFN";
public static final String COL_UNMSBFNRANK = "UnMSBFNRank";
public static final String COL_ADVISOROFUNMSBF = "AdvisorOfUnMSBF";
public static final String COL_ACTIVEEFNV = "ActiveEFNV";
public static final String COL_ACTIVEEFNVRANK = "ActiveEFNVRank";
public static final String COL_ACTIVEEFN = "ActiveEFN";
public static final String COL_ACTIVEEFNRANK = "ActiveEFNRank";
public static final String COL_ADVISOROFACTIVEEF = "AdvisorOfActiveEF";
}
\ No newline at end of file
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
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p>
*
* @author xudong
* @since 2021-07-07
* @since 2021-07-19
*/
public interface VisitSummaryMapper extends BaseMapper<VisitSummaryEntity> {
......
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;
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 = FeignBackClientForProducts.class, url = "http://172.20.1.249:8060/course")
//@FeignClient(value = "service-course", contextId = "course", fallbackFactory = FeignBackClientForCourse.class, url = "${tamp-course-order-svc:}")
@FeignClient(value = "service-course", contextId = "course", fallbackFactory = FeignBackClientForCourse.class, url = "http://172.20.1.249:8060/course")
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;
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.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 io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
......@@ -33,4 +35,14 @@ public interface FeignClientForFatools {
@ApiOperation(value = "查询附件")
@GetMapping(value = "/file/queryFileMap")
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;
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.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 feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
......@@ -42,6 +44,18 @@ public class FeignbackForFatools implements FallbackFactory<FeignClientForFatool
log.info("FeignbackForFatools.getNotRelaySet", throwable);
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();
}
};
}
......
......@@ -30,6 +30,13 @@ public class FeignBackClientForTanpuroom implements FallbackFactory<FeignClientF
log.error("FeignBackClientForTanpuroom.getShortVideoBaseInfo-查询课程req:{}", req);
return null;
}
@Override
public CommonResp<Integer> myOrderCount(String userId) {
log.error("请求信息", throwable);
log.error("FeignBackClientForTanpuroom.myOrderCount-userId:{}", userId);
return null;
}
};
}
}
......@@ -5,6 +5,7 @@ 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.ShortVideoBaseInfoResp;
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.PostMapping;
......@@ -25,4 +26,8 @@ public interface FeignClientForTanpuroom {
@ApiOperation(value = "查询精品课详情")
@PostMapping(value = "/curriculumInfos/detail", produces = {"application/json"})
CommonResp<CurriculumDetailVo> queryCurriculumDetail(@RequestBody CurriCulumInfoDetailDto req);
@ApiOperation("已购总数")
@GetMapping("/my/order/count")
CommonResp<Integer> myOrderCount(@ApiParam(value = "userId", required = true) @RequestParam("userId") String userId);
}
......@@ -2,8 +2,10 @@ package com.tanpu.community.manager;
import com.tanpu.common.constant.ErrorCodeConstant;
import com.tanpu.common.exception.BizException;
import com.tanpu.community.api.beans.resp.FileUploadResp;
import com.tanpu.community.dao.entity.community.FileRecordEntity;
import com.tanpu.community.service.OSSFileService;
import com.tanpu.community.util.ConvertUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -22,7 +24,7 @@ public class FileManager {
@Autowired
private OSSFileService ossFileService;
public FileRecordEntity uploadFile(MultipartFile file) {
public FileUploadResp uploadFile(MultipartFile file) {
if (file == null) {
throw new BizException(ErrorCodeConstant.FILE_UPLOAD_FAIL);
}
......@@ -39,7 +41,8 @@ public class FileManager {
if (data.length == 0 || StringUtils.isEmpty(originalName)){
throw new BizException("上传文件为空");
}
return ossFileService.uploadFile(data, originalName);
FileRecordEntity fileRecordEntity = ossFileService.uploadFile(data, originalName);
return ConvertUtil.fileRecordEntity2Resp(fileRecordEntity);
}
public Map<String,String> getFileUrlByIds(List<String> fileIds){
......
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.req.homepage.FollowRelReq;
import com.tanpu.community.api.beans.req.homepage.QueryFollowReq;
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.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.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.UserInfoService;
import com.tanpu.community.util.ConvertUtil;
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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service
......@@ -24,10 +48,131 @@ public class HomePageManager {
@Autowired
private FollowRelService followRelService;
@Autowired
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<>();
}
//获取用户关注、粉丝列表
......@@ -37,7 +182,7 @@ public class HomePageManager {
List<FollowQo> followQos = new ArrayList<>();
if (!CollectionUtils.isEmpty(userIds)) {
List<UserInfoEntity> userInfos = userInfoService.queryUserByIds(userIds);
List<FollowQo> collect = userInfos.stream().map(ConvertUtil::homePageEntity2FollowQo).collect(Collectors.toList());
List<FollowQo> collect = userInfos.stream().map(ConvertUtil::userInfoEntity2FollowQo).collect(Collectors.toList());
followQos = judgeFollowed(collect, userId);
}
......@@ -65,4 +210,7 @@ public class HomePageManager {
followRelService.deleteFollowRel(req.getFollowUserId(), followerId);
}
}
}
......@@ -30,6 +30,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
......@@ -56,14 +57,11 @@ public class ThemeManager {
@Autowired
private ThemeAttachmentService themeAttachmentService;
@Autowired
private HomePageService homePageService;
@Resource
private ProductService productService;
@Autowired
private OSSFileService ossFileService;
private VisitSummaryService visitSummaryService;
@Autowired
private ESService esService;
......@@ -91,27 +89,44 @@ public class ThemeManager {
BeanUtils.copyProperties(req, themeEntity);
themeEntity.setAuthorId(userId);
themeEntity.setContent(JsonUtil.toJson(req.getContent()));
if (StringUtils.isEmpty(req.getEditThemeId())) {
//新建
themeService.insertTheme(themeEntity);
} else {
//修改
themeService.update(themeEntity, req.getEditThemeId());
themeEntity.setThemeId(req.getEditThemeId());
}
//保存附件表
List<ThemeAttachmentEntity> themeAttachments = ConvertUtil.themeReqToAttachmentList(req, themeEntity.getThemeId());
if (StringUtils.isNotEmpty(req.getEditThemeId())) {
//修改需要刪除
themeAttachmentService.deleteByThemeId(req.getEditThemeId());
}
themeAttachmentService.insertList(themeAttachments);
return CreateThemeResp.builder().themeId(themeEntity.getThemeId()).build();
}
// 返回推荐主题文章
/**
* 返回主题列表
* @param req
* @param userId
* @return
*/
public List<ThemeQo> queryThemes(ThemeListReq req, String userId) {
List<ThemeEntity> themeEntities = new ArrayList<>();
if (ThemeListTypeEnum.RECOMMEND.getCode().equals(req.getType())) {
// TODO:推荐
themeEntities = themeService.selectAll(req.getLastId(), req.getPageSize());
themeEntities = themeService.selectExcludeUser(userId,req.getLastId(), req.getPageSize());
Set<String> recomondThemeIds;
Set<String> hotThemeIds;
Set<String> newThemeIds;
} else if (ThemeListTypeEnum.FOLLOW.getCode().equals(req.getType())) {
//根据关注列表查询
List<String> fansList = followRelService.queryFansByFollowerId(userId);
......@@ -130,6 +145,13 @@ public class ThemeManager {
return convertEntityToQo(themeEntities, userId);
}
public List<ThemeQo> searchThemes(ThemeSearchReq req, String userId) {
List<ThemeEntity> themeEntities= themeService.search(req.getKeyword(),req.getLastId(), req.getPageSize());
return convertEntityToQo(themeEntities, userId);
}
// 返回用户发布、回复、收藏的主题列表
public List<ThemeQo> queryThemesByUser(QueryRecordThemeReq req, String userId) {
......@@ -173,6 +195,7 @@ public class ThemeManager {
.content(Arrays.asList(commentContent))
.formerTheme(f)
.commentId(commentEntity.getCommentId())
.themeType(ThemeTypeEnum.RES_COMMENT.getCode())
.build();
commentThemeList.add(commentThemeQo);
......@@ -225,9 +248,9 @@ public class ThemeManager {
}
//转发
public void forward(ForwardThemeReq req, String userId) {
public CreateThemeResp forward(ForwardThemeReq req, String userId) {
ThemeEntity targetTheme = themeService.queryByThemeId(req.getFormerThemeId());
ThemeEntity newTheme = ThemeEntity.builder()
ThemeEntity themeEntity = ThemeEntity.builder()
.content(JsonUtil.toJson(req.getContent()))
.topicId(req.getTopicId())
.formerThemeId(req.getFormerThemeId())
......@@ -237,11 +260,14 @@ public class ThemeManager {
if (StringUtils.isEmpty(req.getEditThemeId()) || req.getEditThemeId() == req.getFormerThemeId()) {
//新建
themeService.insertTheme(newTheme);
themeService.insertTheme(themeEntity);
} else {
//修改
themeService.update(newTheme, req.getEditThemeId());
themeService.update(themeEntity, req.getEditThemeId());
themeEntity.setThemeId(req.getEditThemeId());
}
return CreateThemeResp.builder().themeId(themeEntity.getThemeId()).build();
}
......@@ -306,12 +332,15 @@ public class ThemeManager {
//是否转发
Integer forwardCountByUser = themeService.getForwardCountByUser(themeId, userId);
themeQo.setHasForward(forwardCountByUser > 0);
//是否收藏
CollectionEntity collectionEntity = collectionService.getNotDeleteTargetCollection(themeId, userId, CollectionTypeEnum.COLLECT_THEME);
themeQo.setHasCollect(collectionEntity != null);
//点赞,收藏,转发
Integer likeCount = collectionService.getCountByTypeAndId(themeId, CollectionTypeEnum.LIKE_THEME);
Integer bookCount = collectionService.getCountByTypeAndId(themeId, CollectionTypeEnum.COLLECT_THEME);
// Integer bookCount = collectionService.getCountByTypeAndId(themeId, CollectionTypeEnum.COLLECT_THEME);
Integer commentCount = commentService.getCommentCountByThemeId(themeId);
Integer forwardCount = themeService.getForwardCountById(themeId);
themeQo.setCommentCount(bookCount);
themeQo.setCommentCount(commentCount);
themeQo.setLikeCount(likeCount);
themeQo.setForwardCount(forwardCount);
}
......@@ -322,15 +351,15 @@ public class ThemeManager {
String formerThemeId = themeQo.getFormerThemeId();
if (StringUtils.isNotEmpty(formerThemeId)) {
ThemeQo formerTheme = ConvertUtil.themeEntityToQo2(themeService.queryByThemeId(formerThemeId));
if (formerTheme == null) {
throw new BizException("转发主题Id错误,id:" + formerThemeId);
}
//单个查询详情
// productService.getAttachDetail(formerTheme);
if (formerTheme != null) {
//单个查询详情
productService.getAttachDetail(formerTheme);
FormerThemeQo f = ConvertUtil.themeQo2FormerThemeQo(formerTheme);
themeQo.setFormerTheme(f);
}
}
}
......@@ -344,4 +373,9 @@ public class ThemeManager {
//TODO
}
public Integer getFollowUpdateCount(String userId) {
LocalDateTime lastViewTime = visitSummaryService.queryLatestViewFollow(userId);
List<String> fansList = followRelService.queryFansByFollowerId(userId);
return themeService.queryCountFromLastTime(fansList, lastViewTime);
}
}
......@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@Service
public class TopicManager {
......@@ -107,6 +108,18 @@ public class TopicManager {
public List<TopicHotQo> getHotTopicTitles() {
List<TopicEntity> topicEntities = topicService.queryAll();
List<TopicHotQo> topicHotQos = ConvertUtil.topicEntityToHotQos(topicEntities);
for (TopicHotQo topic : topicHotQos) {
List<String> themeIds = themeService.queryThemeIdsByTopic(topic.getTopicId());
//浏览量
Integer topicPV = visitSummaryService.queryTopicDetailVisit(topic.getTopicId());
Integer themePV = visitSummaryService.queryThemeVisit(themeIds);
topic.setViewCount(topicPV + themePV);
//讨论数=发布主题贴数+回复总数
Integer commentCount = commentService.getCommentCountByThemeIds(themeIds);
topic.setDisscussCount(themeIds.size() + commentCount);
}
topicHotQos.stream().collect(Collectors.toMap(TopicHotQo::getRank, o->o));
//TODO 添加类型:热 新 顶
topicHotQos.get(0).setType(1);
topicHotQos.get(2).setType(2);
......
......@@ -22,9 +22,14 @@ public class VisitSummaryManager {
visitSummaryService.addPageView(userId, topicId, VisitTypeEnum.TOPIC_PAGE_VIEW);
}
public void addThemePageView(String themeId) {
public void addFollowThemeView(String themeId) {
String userId = userHolder.getUserId();
visitSummaryService.addPageView(userId, themeId, VisitTypeEnum.TOPIC_PAGE_VIEW);
visitSummaryService.addPageView(userId, themeId, VisitTypeEnum.THEME_PAGE_VIEW);
}
public void addFollowThemeView() {
String userId = userHolder.getUserId();
visitSummaryService.addPageView(userId, userId, VisitTypeEnum.FOLLOW_THEME_VIEW);
}
}
......@@ -49,6 +49,13 @@ public class CommentService {
.size();
}
//统计主题集合的评论量
public Integer getCommentCountByThemeId(String themeId) {
return commentMapper.selectList((new LambdaQueryWrapper<CommentEntity>()
.eq(CommentEntity::getThemeId, themeId)))
.size();
}
public Set<String> getCommentUserCount(List<String> themeIds) {
return commentMapper.selectList((new LambdaQueryWrapper<CommentEntity>()
.in(CommentEntity::getThemeId, themeIds)))
......
......@@ -76,11 +76,12 @@ public class OSSFileService {
String[] arr = StringUtils.split(fileName, ".");
String suffix = arr[arr.length - 1];
if (FileTypeEnum.imageTypeSet.contains(suffix)) {
//上传
String id = uuidGenHelper.getUuidStr();
String key = CommunityConstant.OSS_PREFIX_FOLDER+id + "." + suffix;
ossHelper.writeFile(bucketName, key, data, fileSuffix);
//落库
FileRecordEntity record = new FileRecordEntity();
record.setFileId(uuidGenHelper.getUuidStr());
record.setDeleteTag(BizStatus.DeleteTag.tag_init);
......@@ -96,8 +97,10 @@ public class OSSFileService {
fileRecordMapper.insert(record);
return record;
}else {
throw new BizException("文件格式暂不支持:"+suffix);
}
throw new BizException("文件格式中暂不支持");
}
......
......@@ -5,15 +5,15 @@ import com.google.common.collect.Sets;
import com.tanpu.common.api.CommonResp;
import com.tanpu.common.enums.fund.ProductTypeEnum;
import com.tanpu.common.util.JsonUtil;
import com.tanpu.community.api.beans.vo.ImagesDTO;
import com.tanpu.community.api.beans.qo.AttachmentDetailVo;
import com.tanpu.community.api.beans.qo.ThemeContentQo;
import com.tanpu.community.api.beans.qo.ThemeQo;
import com.tanpu.community.api.beans.vo.ImagesDTO;
import com.tanpu.community.api.beans.vo.feign.course.CourseSimpleResp;
import com.tanpu.community.api.beans.vo.feign.course.ShortVideoBaseInfoResp;
import com.tanpu.community.api.beans.vo.feign.product.FundInfoBaseResp;
import com.tanpu.community.api.beans.vo.feign.product.ProductInfoVO;
import com.tanpu.community.api.beans.vo.feign.course.ShortVideoBaseInfoResp;
import com.tanpu.community.api.beans.vo.feign.zhibo.ZhiboListResp;
import com.tanpu.community.api.beans.vo.feign.course.CourseSimpleResp;
import com.tanpu.community.api.enums.RelTypeEnum;
import com.tanpu.community.dao.entity.community.FileRecordEntity;
import com.tanpu.community.dao.entity.community.TopicEntity;
......@@ -225,6 +225,7 @@ public class ProductService {
imgMap.putAll(fileRecordEntities.stream().collect(Collectors
.toMap(FileRecordEntity::getFileId, o -> o)));
}
}
if (!CollectionUtils.isEmpty(topicIds)) {
// 查询话题标题
......@@ -377,6 +378,7 @@ public class ProductService {
if (!StringUtils.isEmpty(themeQo.getAuthorId()) && userMap.containsKey(themeQo.getAuthorId())) {
themeQo.setNickName(userMap.get(themeQo.getAuthorId()).getUiUsernameMp());
themeQo.setUserImg(userMap.get(themeQo.getAuthorId()).getUiHeadimgMp());
themeQo.setUserIntroduction(userMap.get(themeQo.getAuthorId()).getUiIntroductionMp());
}
if (themeQo.getContent() == null) {
continue;
......@@ -415,7 +417,7 @@ public class ProductService {
.product(product).build());
}
} else if (themeContent.getType().equals(RelTypeEnum.SINGLE_IMG.type)) {
//
//单图封装到imglist列表中
if (imgUrlMap.containsKey(themeContent.getValue())) {
FileRecordEntity imgEntity = imgUrlMap.get(themeContent.getValue());
String extInfo = imgEntity.getExtInfo();
......@@ -429,7 +431,7 @@ public class ProductService {
themeContent.setImgList(Collections.singletonList(imagesDTO));
}
}
}else if (themeContent.getType().equals(RelTypeEnum.MULTIPLE_IMAGE.type)) {
} else if (themeContent.getType().equals(RelTypeEnum.MULTIPLE_IMAGE.type)) {
//多图写入图片宽高
List<ImagesDTO> imgList = themeContent.getImgList();
for (ImagesDTO imagesDTO : imgList) {
......
package com.tanpu.community.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.tanpu.community.api.enums.DeleteTagEnum;
import com.tanpu.community.dao.entity.community.ThemeAttachmentEntity;
import com.tanpu.community.dao.mapper.community.ThemeAttachmentMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
......@@ -17,14 +18,21 @@ public class ThemeAttachmentService {
public List<ThemeAttachmentEntity> selectByThemeId(String themeId){
return themeAttachmentMapper.selectList(new LambdaQueryWrapper<ThemeAttachmentEntity>()
.eq(ThemeAttachmentEntity::getThemeId,themeId));
.eq(ThemeAttachmentEntity::getThemeId,themeId)
.eq(ThemeAttachmentEntity::getDeleteTag,DeleteTagEnum.NOT_DELETED));
}
@Transactional
public void insertList(List<ThemeAttachmentEntity> themeAttachments) {
for (ThemeAttachmentEntity themeAttachment : themeAttachments) {
themeAttachmentMapper.insert(themeAttachment);
}
return;
}
public int deleteByThemeId(String themeId) {
ThemeAttachmentEntity target = ThemeAttachmentEntity.builder().deleteTag(DeleteTagEnum.DELETED.getCode()).build();
LambdaUpdateWrapper<ThemeAttachmentEntity> update = new LambdaUpdateWrapper<ThemeAttachmentEntity>().eq(ThemeAttachmentEntity::getThemeId, themeId);
return themeAttachmentMapper.update(target,update);
}
}
package com.tanpu.community.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.tanpu.common.exception.BizException;
import com.tanpu.common.uuid.UuidGenHelper;
import com.tanpu.community.api.enums.DeleteTagEnum;
import com.tanpu.community.dao.entity.community.ThemeEntity;
import com.tanpu.community.dao.mapper.community.ThemeMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List;
import java.util.Set;
......@@ -33,21 +36,21 @@ public class ThemeService {
}
@Transactional
public void update(ThemeEntity themeEntity,String themeId) {
themeEntity.setThemeId(themeId);
themeMapper.updateById(themeEntity);
public void update(ThemeEntity themeEntity, String themeId) {
themeMapper.update(themeEntity, new LambdaUpdateWrapper<ThemeEntity>().eq(ThemeEntity::getThemeId, themeId));
}
//根据id返回主题详情
//根据id返回主题详情(未删)
public ThemeEntity queryByThemeId(String themeId) {
return themeMapper.selectOne(new LambdaQueryWrapper<ThemeEntity>()
.eq(ThemeEntity::getThemeId,themeId));
.eq(ThemeEntity::getThemeId, themeId)
.eq(ThemeEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED.getCode()));
}
public List<ThemeEntity> queryThemesByUserId(String userId) {
return themeMapper.selectList(new LambdaQueryWrapper<ThemeEntity>()
.eq(ThemeEntity::getAuthorId,userId)
.eq(ThemeEntity::getDeleteTag,DeleteTagEnum.NOT_DELETED.getCode())
.eq(ThemeEntity::getAuthorId, userId)
.eq(ThemeEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED.getCode())
.orderByDesc(ThemeEntity::getId));
}
......@@ -58,27 +61,27 @@ public class ThemeService {
.orderByDesc(ThemeEntity::getId);
if (StringUtils.isNotEmpty(lastId)) {
ThemeEntity lastEntity = queryByThemeId(lastId);
if (lastEntity==null) throw new BizException("主题未找到,id:"+lastId);
if (lastEntity == null) throw new BizException("主题未找到,id:" + lastId);
queryWrapper.lt(ThemeEntity::getUpdateTime, lastEntity.getCreateTime());
}
if (pageSize!=null){
queryWrapper.last("limit "+pageSize);
if (pageSize != null) {
queryWrapper.last("limit " + pageSize);
}
return themeMapper.selectList(queryWrapper);
}
//根据ids返回主题详情,带分页
public List<ThemeEntity> queryByThemeIds(List<String> themeIds, String lastId,Integer pageSize) {
public List<ThemeEntity> queryByThemeIds(List<String> themeIds, String lastId, Integer pageSize) {
LambdaQueryWrapper<ThemeEntity> queryWrapper = new LambdaQueryWrapper<ThemeEntity>()
.in(ThemeEntity::getThemeId, themeIds)
.eq(ThemeEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED.getCode());
if (StringUtils.isNotEmpty(lastId)) {
ThemeEntity lastEntity = queryByThemeId(lastId);
if (lastEntity==null) throw new BizException("主题未找到,id:"+lastId);
if (lastEntity == null) throw new BizException("主题未找到,id:" + lastId);
queryWrapper.lt(ThemeEntity::getUpdateTime, lastEntity.getCreateTime());
}
if (pageSize!=null){
queryWrapper.last("limit "+pageSize);
if (pageSize != null) {
queryWrapper.last("limit " + pageSize);
}
return themeMapper.selectList(queryWrapper);
}
......@@ -92,25 +95,35 @@ public class ThemeService {
return themeMapper.selectList(queryWrapper);
}
//分页倒叙lastId之前的主题
public List<ThemeEntity> selectAll(String lastId,Integer pageSize) {
LambdaQueryWrapper<ThemeEntity> queryWrapper = new LambdaQueryWrapper<ThemeEntity>();
/**
* 分页查询,非当前用户的主题
* @param lastId
* @param pageSize
* @param userId
* @return
*/
public List<ThemeEntity> selectExcludeUser(String userId,String lastId, Integer pageSize) {
LambdaQueryWrapper<ThemeEntity> queryWrapper = new LambdaQueryWrapper<>();
if (!StringUtils.isEmpty(userId)){
queryWrapper.ne(ThemeEntity::getAuthorId,userId);
}
if (StringUtils.isNotEmpty(lastId)) {
ThemeEntity lastEntity = queryByThemeId(lastId);
if (lastEntity==null) throw new BizException("主题未找到,id:"+lastId);
if (lastEntity == null) throw new BizException("主题未找到,id:" + lastId);
queryWrapper.lt(ThemeEntity::getUpdateTime, lastEntity.getCreateTime());
}
queryWrapper.last("limit "+pageSize);
queryWrapper.last("limit " + pageSize);
queryWrapper.orderByDesc(ThemeEntity::getId);
queryWrapper.orderByDesc(ThemeEntity::getCreateTime);
queryWrapper.eq(ThemeEntity::getDeleteTag,DeleteTagEnum.NOT_DELETED.getCode());
queryWrapper.eq(ThemeEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED.getCode());
return themeMapper.selectList(queryWrapper);
}
/**
* 根据条件查询最新主题
*
* @param topidId 话题Id
* @param lastId 查询此主题Id之前的主题
* @param pageSize 查询数量
......@@ -121,20 +134,20 @@ public class ThemeService {
.eq(ThemeEntity::getTopicId, topidId);
if (StringUtils.isNotEmpty(lastId)) {
ThemeEntity lastEntity = queryByThemeId(lastId);
if (lastEntity==null) throw new BizException("主题未找到,id:"+lastId);
if (lastEntity == null) throw new BizException("主题未找到,id:" + lastId);
queryWrapper.lt(ThemeEntity::getUpdateTime, lastEntity.getCreateTime());
}
if (pageSize!=null){
queryWrapper.last("limit "+pageSize);
if (pageSize != null) {
queryWrapper.last("limit " + pageSize);
}
queryWrapper.orderByDesc(ThemeEntity::getCreateTime);
queryWrapper.eq(ThemeEntity::getDeleteTag,DeleteTagEnum.NOT_DELETED.getCode());
queryWrapper.eq(ThemeEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED.getCode());
return themeMapper.selectList(queryWrapper);
}
//根据话题查询所有的主题Id
public List<String> queryThemeIdsByTopic(String topidId) {
if(StringUtils.isEmpty(topidId)){
if (StringUtils.isEmpty(topidId)) {
return Collections.emptyList();
}
LambdaQueryWrapper<ThemeEntity> queryWrapper = new LambdaQueryWrapper<ThemeEntity>()
......@@ -150,12 +163,37 @@ public class ThemeService {
.in(ThemeEntity::getAuthorId, userIds);
if (StringUtils.isNotEmpty(lastId)) {
ThemeEntity lastEntity = queryByThemeId(lastId);
if (lastEntity==null) throw new BizException("主题未找到,id:"+lastId);
if (lastEntity == null) throw new BizException("主题未找到,id:" + lastId);
queryWrapper.lt(ThemeEntity::getUpdateTime, lastEntity.getCreateTime());
}
queryWrapper.last("limit " + pageSize);
queryWrapper.orderByDesc(ThemeEntity::getCreateTime);
queryWrapper.eq(ThemeEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED.getCode());
return themeMapper.selectList(queryWrapper);
}
/**
* 根据关键字搜索
* @param keyword
* @param lastId
* @param pageSize
* @return
*/
public List<ThemeEntity> search(String keyword, String lastId, Integer pageSize) {
if (StringUtils.isEmpty(keyword)){
return Collections.emptyList();
}
LambdaQueryWrapper<ThemeEntity> queryWrapper = new LambdaQueryWrapper<ThemeEntity>()
.like(ThemeEntity::getTitle, keyword);
if (StringUtils.isNotEmpty(lastId)) {
ThemeEntity lastEntity = queryByThemeId(lastId);
if (lastEntity == null) throw new BizException("主题未找到,id:" + lastId);
queryWrapper.lt(ThemeEntity::getUpdateTime, lastEntity.getCreateTime());
}
queryWrapper.last("limit "+pageSize);
queryWrapper.last("limit " + pageSize);
queryWrapper.orderByDesc(ThemeEntity::getCreateTime);
queryWrapper.eq(ThemeEntity::getDeleteTag,DeleteTagEnum.NOT_DELETED.getCode());
queryWrapper.eq(ThemeEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED.getCode());
return themeMapper.selectList(queryWrapper);
}
......@@ -170,11 +208,11 @@ public class ThemeService {
public Integer getForwardCountById(String themeId) {
return themeMapper.selectCount(new LambdaQueryWrapper<ThemeEntity>()
.eq(ThemeEntity::getThemeId, themeId)
.eq(ThemeEntity::getFormerThemeId, themeId)
.eq(ThemeEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED));
}
public Integer getForwardCountByUser(String themeId,String userId) {
public Integer getForwardCountByUser(String themeId, String userId) {
return themeMapper.selectCount(new LambdaQueryWrapper<ThemeEntity>()
.eq(ThemeEntity::getFormerThemeId, themeId)
.eq(ThemeEntity::getAuthorId, userId)
......@@ -185,12 +223,31 @@ public class ThemeService {
public void deleteById(String themeId) {
ThemeEntity themeEntity = themeMapper.selectOne(new LambdaQueryWrapper<ThemeEntity>()
.eq(ThemeEntity::getThemeId, themeId));
if (themeEntity==null){
throw new BizException("主题未找到,id:"+themeId);
if (themeEntity == null) {
throw new BizException("主题未找到,id:" + themeId);
}
themeEntity.setDeleteTag(DeleteTagEnum.DELETED.getCode());
themeMapper.updateById(themeEntity);
}
/**
* 查询更新节点后的用户新建主题数
* @param userIds 用户ids
* @param lastViewTime 更新时间节点
* @return
*/
public Integer queryCountFromLastTime(List<String> userIds, LocalDateTime lastViewTime) {
if (CollectionUtils.isEmpty(userIds)) {
return 0;
}
LambdaQueryWrapper<ThemeEntity> queryWrapper = new LambdaQueryWrapper<ThemeEntity>()
.in(ThemeEntity::getAuthorId, userIds)
.eq(ThemeEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED.getCode());
if (lastViewTime != null) {
queryWrapper.gt(ThemeEntity::getCreateTime, lastViewTime);
}
return themeMapper.selectCount(queryWrapper);
}
}
......@@ -5,10 +5,12 @@ import com.tanpu.community.api.enums.VisitTypeEnum;
import com.tanpu.community.dao.entity.community.VisitSummaryEntity;
import com.tanpu.community.dao.mapper.community.VisitSummaryMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
@Slf4j
......@@ -24,6 +26,7 @@ public class VisitSummaryService {
.visitorId(userId)
.refId(targetId)
.refType(type.getCode())
.duration(0)
.build());
}
......@@ -31,25 +34,37 @@ public class VisitSummaryService {
public Integer queryTopicDetailVisit(String topicId) {
return visitSummaryMapper.selectCount(new LambdaQueryWrapper<VisitSummaryEntity>()
.eq(VisitSummaryEntity::getRefId, topicId)
.eq(VisitSummaryEntity::getRefType,VisitTypeEnum.TOPIC_PAGE_VIEW.getCode()));
.eq(VisitSummaryEntity::getRefType, VisitTypeEnum.TOPIC_PAGE_VIEW.getCode()));
}
// 查询主题 浏览量
public Integer queryThemeVisit(String theme) {
return visitSummaryMapper.selectCount(new LambdaQueryWrapper<VisitSummaryEntity>()
.eq(VisitSummaryEntity::getRefId, theme)
.eq(VisitSummaryEntity::getRefType,VisitTypeEnum.TOPIC_PAGE_VIEW.getCode()));
.eq(VisitSummaryEntity::getRefType, VisitTypeEnum.TOPIC_PAGE_VIEW.getCode()));
}
// 查询主题 浏览量
public Integer queryThemeVisit(List<String> themes) {
return visitSummaryMapper.selectCount(new LambdaQueryWrapper<VisitSummaryEntity>()
.in(VisitSummaryEntity::getRefId, themes)
.eq(VisitSummaryEntity::getRefType,VisitTypeEnum.TOPIC_PAGE_VIEW.getCode()));
.eq(VisitSummaryEntity::getRefType, VisitTypeEnum.TOPIC_PAGE_VIEW.getCode()));
}
// 更新访问时长
public void updateDurByIdent(String ident, Integer dur) {
// visitSummaryMapper.updateDurByIdent(ident, dur);
}
public LocalDateTime queryLatestViewFollow(String userId) {
List<VisitSummaryEntity> visitSummaryEntities = visitSummaryMapper.selectList(new LambdaQueryWrapper<VisitSummaryEntity>()
.eq(VisitSummaryEntity::getVisitorId, userId)
.eq(VisitSummaryEntity::getRefType, VisitTypeEnum.FOLLOW_THEME_VIEW.getCode())
.orderByDesc(VisitSummaryEntity::getCreateTime));
if (CollectionUtils.isEmpty(visitSummaryEntities)) {
return null;
} else {
return visitSummaryEntities.get(0).getCreateTime();
}
}
}
......@@ -2,6 +2,7 @@ package com.tanpu.community.util;
import com.fasterxml.jackson.core.type.TypeReference;
import com.tanpu.common.util.JsonUtil;
import com.tanpu.community.api.beans.resp.FileUploadResp;
import com.tanpu.community.api.beans.vo.ImagesDTO;
import com.tanpu.community.api.beans.vo.TopicDTO;
import com.tanpu.community.api.beans.qo.*;
......@@ -12,9 +13,11 @@ import com.tanpu.community.api.enums.RelTypeEnum;
import com.tanpu.community.dao.entity.community.*;
import com.tanpu.community.dao.entity.user.UserInfoEntity;
import org.springframework.beans.BeanUtils;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public class ConvertUtil {
......@@ -163,26 +166,40 @@ public class ConvertUtil {
.themeId(themeId)
.build());
}
} else {
} else if ((content.getType().equals(RelTypeEnum.SINGLE_IMG.type))) {
if (StringUtils.isEmpty(content.getValue())){
list.add(ThemeAttachmentEntity.builder()
.attachType(Integer.valueOf(content.getType()))
.attachId(content.getValue())
.themeId(themeId)
.build());
}else {
List<ImagesDTO> imgList = content.getImgList();
for (ImagesDTO imagesDTO : imgList) {
list.add(ThemeAttachmentEntity.builder()
.attachType(Integer.valueOf(RelTypeEnum.SINGLE_IMG.type))
.attachId(imagesDTO.getRelId())
.themeId(themeId)
.build());
}
}
} else {
}
}
}
return list;
}
public static FollowQo homePageEntity2FollowQo(UserInfoEntity entity) {
public static FollowQo userInfoEntity2FollowQo(UserInfoEntity entity) {
if (entity == null) {
return null;
}
return FollowQo.builder().userId(entity.getId())
.nickName(entity.getUiUsernameMp())
.headImg(entity.getUiHeadimgMp())
.introduction(entity.getUiIntroduction())
.introduction(entity.getUiIntroductionMp())
.build();
}
......@@ -202,6 +219,18 @@ public class ConvertUtil {
.build();
}
public static FileUploadResp fileRecordEntity2Resp(FileRecordEntity entity){
FileUploadResp resp = new FileUploadResp();
BeanUtils.copyProperties(entity,resp);
String extInfo = entity.getExtInfo();
if (!StringUtils.isEmpty(extInfo)) {
Map<String, Object> extMap = JsonUtil.toMap(extInfo);
resp.setImgHeight((Integer) extMap.get("height"));
resp.setImgWidth((Integer) extMap.get("width"));
}
return resp;
}
}
......@@ -46,6 +46,22 @@ spring.datasource:
maxActive: 2
minIdle: 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:
host: 118.190.63.109
......
......@@ -11,9 +11,7 @@
<result column="ref_id" property="refId" />
<result column="ref_type" property="refType" />
<result column="duration" property="duration" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" />
</resultMap>
......
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