Commit d275579c by 阮思源

Merge branch 'zyj-1002062' into 'master'

出版端社群书统计

See merge request rays/pcloud-book!306
parents cacc9d74 a27b2db6
package com.pcloud.book.group.dto; package com.pcloud.book.group.dto;
import com.pcloud.common.dto.BaseDto;
import lombok.Data; import lombok.Data;
/** /**
...@@ -8,10 +10,21 @@ import lombok.Data; ...@@ -8,10 +10,21 @@ import lombok.Data;
* @Date 2019/11/22 14:48 * @Date 2019/11/22 14:48
**/ **/
@Data @Data
public class AltAndCountDTO { public class AltAndCountDTO extends BaseDto{
/**
* 小号id
*/
private String altId; private String altId;
private Integer count; private Integer count;
/**
* 昵称
*/
private String nickName;
/**
* 好友数量
*/
private Integer friendCount;
} }
...@@ -150,4 +150,14 @@ public class BrowseRecordConsr { ...@@ -150,4 +150,14 @@ public class BrowseRecordConsr {
return map; return map;
} }
@ParamLog("根据群分类获取应用/资源浏览量")
public Map<Long, GroupBrowseStatisticVO> mapServeBrowseStatisticByClassify(List<Long> serveIds, String serveType, Long classifyId) {
Map<Long, GroupBrowseStatisticVO> map = null;
try {
map = ResponseHandleUtil.parseMapResponse(browseRecordService.mapServeBrowseStatisticByClassify(serveIds, serveType,classifyId), Long.class, GroupBrowseStatisticVO.class);
} catch (Exception e) {
LOGGER.error("根据群分类获取应用/资源浏览量失败" + e.getMessage(), e);
}
return map;
}
} }
...@@ -6,6 +6,7 @@ import com.pcloud.book.group.dto.AppStatisticsDTO; ...@@ -6,6 +6,7 @@ import com.pcloud.book.group.dto.AppStatisticsDTO;
import com.pcloud.book.group.dto.BookGroupCountDTO; import com.pcloud.book.group.dto.BookGroupCountDTO;
import com.pcloud.book.group.dto.BookGroupDTO; import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.dto.BookGroupKeywordResourceDTO; import com.pcloud.book.group.dto.BookGroupKeywordResourceDTO;
import com.pcloud.book.group.dto.BookGroupStatistic4AgentDTO;
import com.pcloud.book.group.dto.BookGroupStatisticsDTO; import com.pcloud.book.group.dto.BookGroupStatisticsDTO;
import com.pcloud.book.group.dto.ChangeQrCodeTypeDto; import com.pcloud.book.group.dto.ChangeQrCodeTypeDto;
import com.pcloud.book.group.dto.ClassifyKeywordDTO; import com.pcloud.book.group.dto.ClassifyKeywordDTO;
...@@ -42,6 +43,7 @@ import com.pcloud.book.group.vo.StatisticVO; ...@@ -42,6 +43,7 @@ import com.pcloud.book.group.vo.StatisticVO;
import com.pcloud.book.group.vo.TotalRescourceDataVO; import com.pcloud.book.group.vo.TotalRescourceDataVO;
import com.pcloud.book.group.vo.UserBookInfoVO; import com.pcloud.book.group.vo.UserBookInfoVO;
import com.pcloud.book.group.vo.WxGroupStatisticVO; import com.pcloud.book.group.vo.WxGroupStatisticVO;
import com.pcloud.book.keywords.vo.ListKeywordVO;
import com.pcloud.common.dto.StoreFlowInfoDto; import com.pcloud.common.dto.StoreFlowInfoDto;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBean; import com.pcloud.common.page.PageBean;
...@@ -705,4 +707,18 @@ public interface BookGroupBiz { ...@@ -705,4 +707,18 @@ public interface BookGroupBiz {
* @return * @return
*/ */
List<BookGroupCountDTO> getAssocBookGroupCount(List<BookGroupCountDTO> dtos); List<BookGroupCountDTO> getAssocBookGroupCount(List<BookGroupCountDTO> dtos);
/**
* 出版社根据bookId获取社群码统计信息
* @param bookId
* @return
*/
BookGroupStatistic4AgentDTO getBookGroupStatisticsByAgent(Long bookId);
/**
* 获取群分类关键词数据
* @param classifyId
* @return
*/
List<ListKeywordVO> getClassifyKeywordStatistic(Long classifyId);
} }
...@@ -140,4 +140,18 @@ public interface BookGroupCipherUserDao extends BaseDao<BookGroupCipherUser> { ...@@ -140,4 +140,18 @@ public interface BookGroupCipherUserDao extends BaseDao<BookGroupCipherUser> {
* @return * @return
*/ */
public List<String> getFriendIdListByBookAndRobot(String altId, List<Long> bookIds); public List<String> getFriendIdListByBookAndRobot(String altId, List<Long> bookIds);
/**
* 获取与社群书关联的小号数量
* @param bookGroupId
* @return
*/
Integer getAltCountByBookGroup(Long bookGroupId);
/**
* 社群书关联的小号及好友数量
* @param bookGroupId
* @return
*/
List<AltAndCountDTO> getAltFriendList(Long bookGroupId);
} }
...@@ -2,6 +2,7 @@ package com.pcloud.book.group.dao; ...@@ -2,6 +2,7 @@ package com.pcloud.book.group.dao;
import com.pcloud.book.group.dto.AgentStatisticsInfoDTO; import com.pcloud.book.group.dto.AgentStatisticsInfoDTO;
import com.pcloud.book.group.dto.BookGroupDTO; import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.dto.BookGroupStatistic4AgentDTO;
import com.pcloud.book.group.dto.PersonalQrcodeDTO; import com.pcloud.book.group.dto.PersonalQrcodeDTO;
import com.pcloud.book.group.dto.QrcodeNameAndProIdDTO; import com.pcloud.book.group.dto.QrcodeNameAndProIdDTO;
import com.pcloud.book.group.dto.TopAgentBookGroupDTO; import com.pcloud.book.group.dto.TopAgentBookGroupDTO;
...@@ -290,4 +291,11 @@ public interface BookGroupDao extends BaseDao<BookGroup> { ...@@ -290,4 +291,11 @@ public interface BookGroupDao extends BaseDao<BookGroup> {
* @param belongSpecialAgent * @param belongSpecialAgent
*/ */
public void updateSpecialState(Long id, Boolean belongSpecialAgent); public void updateSpecialState(Long id, Boolean belongSpecialAgent);
/**
* 根据书刊id获取社群书基本信息
* @param bookId
* @return
*/
BookGroupStatistic4AgentDTO getBaseInfoByBookId(Long bookId);
} }
...@@ -158,4 +158,14 @@ public class BookGroupCipherUserDaoImpl extends BaseDaoImpl<BookGroupCipherUser> ...@@ -158,4 +158,14 @@ public class BookGroupCipherUserDaoImpl extends BaseDaoImpl<BookGroupCipherUser>
map.put("altId", altId); map.put("altId", altId);
return getSessionTemplate().selectList(getStatement("getFriendIdListByBookAndRobot"), map); return getSessionTemplate().selectList(getStatement("getFriendIdListByBookAndRobot"), map);
} }
@Override
public Integer getAltCountByBookGroup(Long bookGroupId) {
return getSessionTemplate().selectOne(getStatement("getAltCountByBookGroup"), bookGroupId);
}
@Override
public List<AltAndCountDTO> getAltFriendList(Long bookGroupId) {
return getSessionTemplate().selectList(getStatement("getAltFriendList"), bookGroupId);
}
} }
...@@ -3,6 +3,7 @@ package com.pcloud.book.group.dao.impl; ...@@ -3,6 +3,7 @@ package com.pcloud.book.group.dao.impl;
import com.pcloud.book.group.dao.BookGroupDao; import com.pcloud.book.group.dao.BookGroupDao;
import com.pcloud.book.group.dto.AgentStatisticsInfoDTO; import com.pcloud.book.group.dto.AgentStatisticsInfoDTO;
import com.pcloud.book.group.dto.BookGroupDTO; import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.dto.BookGroupStatistic4AgentDTO;
import com.pcloud.book.group.dto.PersonalQrcodeDTO; import com.pcloud.book.group.dto.PersonalQrcodeDTO;
import com.pcloud.book.group.dto.QrcodeNameAndProIdDTO; import com.pcloud.book.group.dto.QrcodeNameAndProIdDTO;
import com.pcloud.book.group.dto.TopAgentBookGroupDTO; import com.pcloud.book.group.dto.TopAgentBookGroupDTO;
...@@ -330,4 +331,9 @@ public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGrou ...@@ -330,4 +331,9 @@ public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGrou
paramMap.put("belongSpecialAgent", belongSpecialAgent); paramMap.put("belongSpecialAgent", belongSpecialAgent);
getSessionTemplate().update(getStatement("updateSpecialState"), paramMap); getSessionTemplate().update(getStatement("updateSpecialState"), paramMap);
} }
@Override
public BookGroupStatistic4AgentDTO getBaseInfoByBookId(Long bookId) {
return getSessionTemplate().selectOne(getStatement("getBaseInfoByBookId"), bookId);
}
} }
package com.pcloud.book.group.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.pcloud.book.group.entity.BookGroupServe;
import com.pcloud.book.keywords.vo.ListKeywordVO;
import com.pcloud.common.dto.BaseDto;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @描述:出版端书刊社群码数据
* @作者:zhuyajie
* @创建时间:14:40 2020/1/6
* @版本:1.0
*/
@Data
@ApiModel("出版端书刊社群码数据")
public class BookGroupStatistic4AgentDTO extends BaseDto {
@ApiModelProperty("社群书id")
private Long bookGroupId;
@ApiModelProperty("群二维码图片")
private String groupQrcodeUrl;
@ApiModelProperty("群二维码名称")
private String groupQrcodeName;
@ApiModelProperty("创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
@ApiModelProperty("进群方式")
private Integer joinGroupType;
@ApiModelProperty("浏览量")
private Integer browseCount;
@ApiModelProperty("浏览人数")
private Integer browserCount;
@ApiModelProperty("平均浏览时长")
private Long avgbrowseTimes;
@ApiModelProperty("购买次数")
private Long saleCount;
@ApiModelProperty("销售额")
private Double saleAmount;
/**
* 个人号列表
*/
private List<AltAndCountDTO> altAndCountDTOS;
/**
* 个人号配置资源数据统计
*/
private List<BookGroupServe> bookGroupServeList;
}
...@@ -27,6 +27,9 @@ public class ClassifyKeywordDTO implements Serializable { ...@@ -27,6 +27,9 @@ public class ClassifyKeywordDTO implements Serializable {
@ApiModelProperty("用户数量") @ApiModelProperty("用户数量")
private Integer userCount; private Integer userCount;
@ApiModelProperty("社群id")
private Long bookGroupId;
private List<ListKeywordVO> listKeywordVOS; private List<ListKeywordVO> listKeywordVOS;
public Long getClassifyId() { public Long getClassifyId() {
...@@ -69,6 +72,14 @@ public class ClassifyKeywordDTO implements Serializable { ...@@ -69,6 +72,14 @@ public class ClassifyKeywordDTO implements Serializable {
this.listKeywordVOS = listKeywordVOS; this.listKeywordVOS = listKeywordVOS;
} }
public Long getBookGroupId() {
return bookGroupId;
}
public void setBookGroupId(Long bookGroupId) {
this.bookGroupId = bookGroupId;
}
@Override @Override
public String toString() { public String toString() {
return "ClassifyKeywordDTO{" + return "ClassifyKeywordDTO{" +
...@@ -76,6 +87,7 @@ public class ClassifyKeywordDTO implements Serializable { ...@@ -76,6 +87,7 @@ public class ClassifyKeywordDTO implements Serializable {
", classify='" + classify + '\'' + ", classify='" + classify + '\'' +
", groupCount=" + groupCount + ", groupCount=" + groupCount +
", userCount=" + userCount + ", userCount=" + userCount +
", bookGroupId=" + bookGroupId +
", listKeywordVOS=" + listKeywordVOS + ", listKeywordVOS=" + listKeywordVOS +
'}'; '}';
} }
......
...@@ -2,12 +2,14 @@ package com.pcloud.book.group.entity; ...@@ -2,12 +2,14 @@ package com.pcloud.book.group.entity;
import com.pcloud.common.entity.BaseEntity; import com.pcloud.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/** /**
* @Description * @Description
* @Author ruansiyuan * @Author ruansiyuan
* @Date 2019/9/23 15:35 * @Date 2019/9/23 15:35
**/ **/
@Data
public class BookGroupServe extends BaseEntity { public class BookGroupServe extends BaseEntity {
private static final long serialVersionUID = 7725930392678110441L; private static final long serialVersionUID = 7725930392678110441L;
...@@ -38,92 +40,28 @@ public class BookGroupServe extends BaseEntity { ...@@ -38,92 +40,28 @@ public class BookGroupServe extends BaseEntity {
@ApiModelProperty("是否超级作者") @ApiModelProperty("是否超级作者")
private Boolean isSuper; private Boolean isSuper;
@ApiModelProperty("销售价")
private Double retailPrice;
@ApiModelProperty("协议价")
private Double dealPrice;
@ApiModelProperty("浏览量")
private Integer browseCount;
@ApiModelProperty("浏览人数")
private Integer browserCount;
@ApiModelProperty("平均浏览时长")
private Long avgbrowseTimes;
@ApiModelProperty("购买次数")
private Integer saleCount;
@ApiModelProperty("图片地址")
private String picUrl;
@ApiModelProperty("描述信息")
private String description;
public Long getServeId() {
return serveId;
}
public void setServeId(Long serveId) {
this.serveId = serveId;
}
public String getServeType() {
return serveType;
}
public void setServeType(String serveType) {
this.serveType = serveType;
}
public String getServeUrl() {
return serveUrl;
}
public void setServeUrl(String serveUrl) {
this.serveUrl = serveUrl;
}
public String getShortUrl() {
return shortUrl;
}
public void setShortUrl(String shortUrl) {
this.shortUrl = shortUrl;
}
public Long getBookGroupId() {
return bookGroupId;
}
public void setBookGroupId(Long bookGroupId) {
this.bookGroupId = bookGroupId;
}
public Long getCreateUser() {
return createUser;
}
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
public String getServeName() {
return serveName;
}
public void setServeName(String serveName) {
this.serveName = serveName;
}
public String getFromType() {
return fromType;
}
public void setFromType(String fromType) {
this.fromType = fromType;
}
public Boolean getIsSuper() {
return isSuper;
}
public void setIsSuper(Boolean isSuper) {
this.isSuper = isSuper;
}
@Override
public String toString() {
return "BookGroupServe{" +
"serveId=" + serveId +
", serveType='" + serveType + '\'' +
", serveUrl='" + serveUrl + '\'' +
", shortUrl='" + shortUrl + '\'' +
", bookGroupId=" + bookGroupId +
", createUser=" + createUser +
", serveName='" + serveName + '\'' +
", fromType='" + fromType + '\'' +
", isSuper=" + isSuper +
"} " + super.toString();
}
} }
...@@ -17,6 +17,7 @@ import com.pcloud.book.group.vo.ListBookGroup4ChannelParamVO; ...@@ -17,6 +17,7 @@ import com.pcloud.book.group.vo.ListBookGroup4ChannelParamVO;
import com.pcloud.book.group.vo.ResourcesStatisticVO; import com.pcloud.book.group.vo.ResourcesStatisticVO;
import com.pcloud.book.group.vo.UpdateRankTypeVO; import com.pcloud.book.group.vo.UpdateRankTypeVO;
import com.pcloud.book.group.vo.UserBookInfoVO; import com.pcloud.book.group.vo.UserBookInfoVO;
import com.pcloud.book.keywords.vo.ListKeywordVO;
import com.pcloud.common.dto.ResponseDto; import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBean; import com.pcloud.common.page.PageBean;
...@@ -291,7 +292,7 @@ public interface BookGroupFacade { ...@@ -291,7 +292,7 @@ public interface BookGroupFacade {
@RequestParam("bookId") Long bookId @RequestParam("bookId") Long bookId
) throws BizException, PermissionException, JsonParseException; ) throws BizException, PermissionException, JsonParseException;
@ApiOperation("根据bookId获取社群书分类和关键词等统计信息") @ApiOperation("根据bookId获取社群书群分类资源统计信息")
@GetMapping("getBookGroupKeywordStatistics") @GetMapping("getBookGroupKeywordStatistics")
ResponseDto<?> getBookGroupKeywordStatistics( ResponseDto<?> getBookGroupKeywordStatistics(
@RequestHeader("token") String token, @RequestHeader("token") String token,
...@@ -656,4 +657,16 @@ public interface BookGroupFacade { ...@@ -656,4 +657,16 @@ public interface BookGroupFacade {
}) })
@GetMapping("updateSpecialState") @GetMapping("updateSpecialState")
public ResponseDto<?> updateSpecialState(@RequestParam("id") Long id, @RequestParam("belongSpecialAgent") Boolean belongSpecialAgent); public ResponseDto<?> updateSpecialState(@RequestParam("id") Long id, @RequestParam("belongSpecialAgent") Boolean belongSpecialAgent);
@ApiOperation("出版社根据bookId获取社群码统计信息")
@GetMapping("getBookGroupStatisticsByAgent")
ResponseDto<?> getBookGroupStatisticsByAgent(
@RequestHeader("token") String token,
@RequestParam("bookId") Long bookId
) throws BizException, PermissionException, JsonParseException;
@ApiOperation("获取群分类关键词数据")
@GetMapping("getClassifyKeywordStatistic")
ResponseDto<List<ListKeywordVO>> getClassifyKeywordStatistic(
@RequestHeader("token") String token, @RequestParam("classifyId") Long classifyId) throws PermissionException;
} }
...@@ -26,6 +26,7 @@ import com.pcloud.book.group.vo.TotalRescourceDataVO; ...@@ -26,6 +26,7 @@ import com.pcloud.book.group.vo.TotalRescourceDataVO;
import com.pcloud.book.group.vo.UpdateRankTypeVO; import com.pcloud.book.group.vo.UpdateRankTypeVO;
import com.pcloud.book.group.vo.UserBookInfoVO; import com.pcloud.book.group.vo.UserBookInfoVO;
import com.pcloud.book.group.vo.WxGroupStatisticVO; import com.pcloud.book.group.vo.WxGroupStatisticVO;
import com.pcloud.book.keywords.vo.ListKeywordVO;
import com.pcloud.common.core.constant.SystemCode; import com.pcloud.common.core.constant.SystemCode;
import com.pcloud.common.dto.ResponseDto; import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
...@@ -405,7 +406,7 @@ public class BookGroupFacadeImpl implements BookGroupFacade { ...@@ -405,7 +406,7 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
return new ResponseDto<>(bookGroupBiz.getBookGroupStatistics(bookId)); return new ResponseDto<>(bookGroupBiz.getBookGroupStatistics(bookId));
} }
@ApiOperation("根据bookId获取社群书分类和关键词等统计信息") @ApiOperation("根据bookId获取社群书群分类资源统计信息")
@GetMapping("getBookGroupKeywordStatistics") @GetMapping("getBookGroupKeywordStatistics")
@Override @Override
public ResponseDto<?> getBookGroupKeywordStatistics( public ResponseDto<?> getBookGroupKeywordStatistics(
...@@ -1015,4 +1016,30 @@ public class BookGroupFacadeImpl implements BookGroupFacade { ...@@ -1015,4 +1016,30 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
bookGroupBiz.updateSpecialState(id, belongSpecialAgent); bookGroupBiz.updateSpecialState(id, belongSpecialAgent);
return new ResponseDto<>(); return new ResponseDto<>();
} }
@ApiOperation("出版社根据bookId获取社群码统计信息")
@GetMapping("getBookGroupStatisticsByAgent")
@Override
public ResponseDto<?> getBookGroupStatisticsByAgent(
@RequestHeader("token") String token,
@RequestParam("bookId") Long bookId
) throws BizException, PermissionException, JsonParseException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (bookId == null) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "bookId不能为空!");
}
return new ResponseDto<>(bookGroupBiz.getBookGroupStatisticsByAgent(bookId));
}
@Override
@GetMapping("getClassifyKeywordStatistic")
public ResponseDto<List<ListKeywordVO>> getClassifyKeywordStatistic(
@RequestHeader("token") String token, @RequestParam("classifyId") Long classifyId) throws PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (classifyId == null) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "classifyId不能为空!");
}
List<ListKeywordVO> listKeywordVOS = bookGroupBiz.getClassifyKeywordStatistic(classifyId);
return new ResponseDto<>(listKeywordVOS);
}
} }
...@@ -25,6 +25,23 @@ public class StatisticVO implements Serializable { ...@@ -25,6 +25,23 @@ public class StatisticVO implements Serializable {
* 用户数量 * 用户数量
*/ */
private Integer userNumber; private Integer userNumber;
/**
* 进群方式
*/
private Integer joinGroupType;
/**
* 个人号数量
*/
private Integer robotCount;
/**
* 总好友数
*/
private Integer friendCount;
/**
* 社群书id
*/
private Long bookGroupId;
public Integer getClassifyCount() { public Integer getClassifyCount() {
return classifyCount; return classifyCount;
...@@ -50,12 +67,48 @@ public class StatisticVO implements Serializable { ...@@ -50,12 +67,48 @@ public class StatisticVO implements Serializable {
this.userNumber = userNumber; this.userNumber = userNumber;
} }
public Integer getJoinGroupType() {
return joinGroupType;
}
public void setJoinGroupType(Integer joinGroupType) {
this.joinGroupType = joinGroupType;
}
public Integer getRobotCount() {
return robotCount;
}
public void setRobotCount(Integer robotCount) {
this.robotCount = robotCount;
}
public Integer getFriendCount() {
return friendCount;
}
public void setFriendCount(Integer friendCount) {
this.friendCount = friendCount;
}
public Long getBookGroupId() {
return bookGroupId;
}
public void setBookGroupId(Long bookGroupId) {
this.bookGroupId = bookGroupId;
}
@Override @Override
public String toString() { public String toString() {
return "BookGroupStatisticDTO{" + return "StatisticVO{" +
", classifyCount=" + classifyCount + "classifyCount=" + classifyCount +
", groupNumber=" + groupNumber + ", groupNumber=" + groupNumber +
", userNumber=" + userNumber + ", userNumber=" + userNumber +
", joinGroupType=" + joinGroupType +
", robotCount=" + robotCount +
", friendCount=" + friendCount +
", bookGroupId=" + bookGroupId +
'}'; '}';
} }
} }
...@@ -93,11 +93,11 @@ public interface BookKeywordDao extends BaseDao<BookKeyword> { ...@@ -93,11 +93,11 @@ public interface BookKeywordDao extends BaseDao<BookKeyword> {
Integer getKeywordCount(Long bookGroupId, Long classifyId); Integer getKeywordCount(Long bookGroupId, Long classifyId);
/** /**
* 根据分类id集合获取 * 根据分类id获取
* @param classifyIds * @param classifyId
* @return * @return
*/ */
List<ListKeywordVO> getKeywordsByClassifyIds(List<Long> classifyIds, Long bookId); List<ListKeywordVO> getKeywordsByClassifyId(Long classifyId, Long bookId);
/** /**
* @description 根据booGroupId获取关键词id * @description 根据booGroupId获取关键词id
...@@ -155,4 +155,11 @@ public interface BookKeywordDao extends BaseDao<BookKeyword> { ...@@ -155,4 +155,11 @@ public interface BookKeywordDao extends BaseDao<BookKeyword> {
* 查询所有的作品应用类型的关键词 * 查询所有的作品应用类型的关键词
*/ */
List<BookGroupApp> getAllAppKeyword(); List<BookGroupApp> getAllAppKeyword();
/**
* 根据分类id获取应用关键词回复
* @param classifyId
* @return
*/
List<ListKeywordVO> getAppKeywordsByClassifyId(Long classifyId, Long bookGroupId, List<Long> keywordIdList);
} }
...@@ -120,11 +120,11 @@ public class BookKeywordDaoImpl extends BaseDaoImpl<BookKeyword> implements Book ...@@ -120,11 +120,11 @@ public class BookKeywordDaoImpl extends BaseDaoImpl<BookKeyword> implements Book
} }
@Override @Override
public List<ListKeywordVO> getKeywordsByClassifyIds(List<Long> classifyIds, Long bookId) { public List<ListKeywordVO> getKeywordsByClassifyId(Long classifyId, Long bookId) {
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("classifyIds", classifyIds); paramMap.put("classifyId", classifyId);
paramMap.put("bookId", bookId); paramMap.put("bookId", bookId);
return this.getSqlSession().selectList(this.getStatement("getKeywordsByClassifyIds"), paramMap); return this.getSqlSession().selectList(this.getStatement("getKeywordsByClassifyId"), paramMap);
} }
@Override @Override
...@@ -192,4 +192,13 @@ public class BookKeywordDaoImpl extends BaseDaoImpl<BookKeyword> implements Book ...@@ -192,4 +192,13 @@ public class BookKeywordDaoImpl extends BaseDaoImpl<BookKeyword> implements Book
return getSessionTemplate().selectList(getStatement("getAllAppKeyword")); return getSessionTemplate().selectList(getStatement("getAllAppKeyword"));
} }
@Override
public List<ListKeywordVO> getAppKeywordsByClassifyId(Long classifyId, Long bookGroupId, List<Long> keywordIdList) {
Map<String, Object> paramMap = new HashMap();
paramMap.put("classifyId", classifyId);
paramMap.put("bookGroupId", bookGroupId);
paramMap.put("keywordIdList", keywordIdList);
return getSessionTemplate().selectList(getStatement("getAppKeywordsByClassifyId"), paramMap);
}
} }
...@@ -70,7 +70,7 @@ public class ListKeywordVO implements Serializable { ...@@ -70,7 +70,7 @@ public class ListKeywordVO implements Serializable {
@ApiModelProperty("协议价") @ApiModelProperty("协议价")
private Double dealPrice; private Double dealPrice;
@ApiModelProperty("协议价") @ApiModelProperty("渠道id")
private Long channelId; private Long channelId;
@ApiModelProperty("应用或作品类型") @ApiModelProperty("应用或作品类型")
...@@ -82,4 +82,15 @@ public class ListKeywordVO implements Serializable { ...@@ -82,4 +82,15 @@ public class ListKeywordVO implements Serializable {
@ApiModelProperty("是否可编辑0-否,1-是") @ApiModelProperty("是否可编辑0-否,1-是")
private Integer isEdit; private Integer isEdit;
@ApiModelProperty("浏览量")
private Integer browseCount;
@ApiModelProperty("浏览人数")
private Integer browserCount;
@ApiModelProperty("平均浏览时长")
private Long avgbrowseTimes;
@ApiModelProperty("购买次数")
private Integer saleCount;
} }
...@@ -454,4 +454,25 @@ ...@@ -454,4 +454,25 @@
</if> </if>
</select> </select>
<select id="getAltCountByBookGroup" parameterType="long" resultType="integer">
SELECT
COUNT(DISTINCT alt_id)
FROM
book_group_cipher_user
WHERE
book_group_id = #{bookGroupId}
</select>
<select id="getAltFriendList" parameterType="long" resultType="com.pcloud.book.group.dto.AltAndCountDTO">
SELECT
alt_id altId,
COUNT(DISTINCT wx_user_id) friendCount
FROM
book_group_cipher_user
WHERE
book_group_id = #{bookGroupId}
GROUP BY
alt_id
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -847,13 +847,17 @@ ...@@ -847,13 +847,17 @@
SELECT SELECT
COUNT(DISTINCT t1.id) classifyCount, COUNT(DISTINCT t1.id) classifyCount,
COUNT(DISTINCT t2.id) groupNumber, COUNT(DISTINCT t2.id) groupNumber,
IFNULL(SUM(t2.user_number),0) userNumber IFNULL(SUM(t2.user_number), 0) userNumber,
g.join_group_type joinGroupType,
t1.book_group_id bookGroupId
FROM FROM
book_group_classify t1 book_group_classify t1
left JOIN book_group_qrcode t2 ON t1.id = t2.classify_id LEFT JOIN book_group_qrcode t2 ON t1.id = t2.classify_id
AND t2.is_delete = 0 AND t2.is_delete = 0
LEFT JOIN book_group g ON t1.book_group_id = g.id
WHERE WHERE
t1.is_delete = 0 t1.is_delete = 0
AND g.is_delete = 0
AND t1.book_id = #{bookId} AND t1.book_id = #{bookId}
</select> </select>
...@@ -863,13 +867,16 @@ ...@@ -863,13 +867,16 @@
t1.id classifyId, t1.id classifyId,
t1.classify classify, t1.classify classify,
COUNT(DISTINCT t2.id) groupCount, COUNT(DISTINCT t2.id) groupCount,
IFNULL(SUM(t2.user_number),0) userCount IFNULL(SUM(t2.user_number), 0) userCount,
t1.book_group_id bookGroupId
FROM FROM
book_group_classify t1 book_group_classify t1
left JOIN book_group_qrcode t2 ON t1.id = t2.classify_id LEFT JOIN book_group_qrcode t2 ON t1.id = t2.classify_id
AND t2.is_delete = 0 AND t2.is_delete = 0
LEFT JOIN book_group g ON t1.book_group_id = g.id
WHERE WHERE
t1.is_delete = 0 t1.is_delete = 0
AND g.is_delete = 0
AND t1.book_id = #{bookId} AND t1.book_id = #{bookId}
group by t1.id group by t1.id
</select> </select>
......
...@@ -888,4 +888,19 @@ ...@@ -888,4 +888,19 @@
UPDATE book_group SET belong_special_agent = #{belongSpecialAgent} WHERE id = #{id} UPDATE book_group SET belong_special_agent = #{belongSpecialAgent} WHERE id = #{id}
</update> </update>
<select id="getBaseInfoByBookId" parameterType="long" resultType="com.pcloud.book.group.dto.BookGroupStatistic4AgentDTO">
SELECT
id bookGroupId,
group_qrcode_name groupQrcodeName,
group_qrcode_url groupQrcodeUrl,
create_time createTime,
join_group_type joinGroupType
FROM
book_group
WHERE
is_delete = 0
AND book_id = #{bookId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -741,6 +741,8 @@ ...@@ -741,6 +741,8 @@
<select id="getWechatGroupInfoMap" parameterType="list" resultType="com.pcloud.book.group.dto.GroupQrcodeInfo4Advertising"> <select id="getWechatGroupInfoMap" parameterType="list" resultType="com.pcloud.book.group.dto.GroupQrcodeInfo4Advertising">
SELECT SELECT
t.id groupQrcodeId, t.id groupQrcodeId,
t.classify_id classifyId,
t1.book_group_id bookGroupId,
t.group_name groupName, t.group_name groupName,
t.qrcode_url qrcodeUrl, t.qrcode_url qrcodeUrl,
bg.join_group_type joinGroupType bg.join_group_type joinGroupType
......
...@@ -347,8 +347,8 @@ ...@@ -347,8 +347,8 @@
order by t.create_time desc order by t.create_time desc
</select> </select>
<!--根据分类id集合获取--> <!--根据分类id获取-->
<select id="getKeywordsByClassifyIds" parameterType="map" resultType="com.pcloud.book.keywords.vo.ListKeywordVO"> <select id="getKeywordsByClassifyId" parameterType="map" resultType="com.pcloud.book.keywords.vo.ListKeywordVO">
SELECT SELECT
bk.id bookKeywordId, bk.id bookKeywordId,
k.id keywordId, k.id keywordId,
...@@ -370,11 +370,12 @@ ...@@ -370,11 +370,12 @@
WHERE WHERE
bk.is_delete = 0 bk.is_delete = 0
AND k.is_delete = 0 AND k.is_delete = 0
AND (bk.classify_id IN AND (
<foreach collection="classifyIds" item="item" open="(" separator="," close=")"> bk.classify_id = #{classifyId} OR bk.classify_id = 0
#{item} )
</foreach> AND bk.book_id = #{bookId}
or bk.book_id =#{bookId}) GROUP BY
bk.keyword_id
ORDER BY ORDER BY
bk.rank ASC,bk.id DESC bk.rank ASC,bk.id DESC
</select> </select>
...@@ -574,4 +575,44 @@ ...@@ -574,4 +575,44 @@
t1.serve_id, t1.serve_id,
t1.serve_type t1.serve_type
</select> </select>
<select id="getAppKeywordsByClassifyId" parameterType="map" resultType="com.pcloud.book.keywords.vo.ListKeywordVO">
SELECT
bk.id bookKeywordId,
k.id keywordId,
k.keywords,
k.matching_rule matchingRule,
k.guide,
bk.rank,
k.content,
k.description,
k.link_url linkUrl,
k.pic_url picUrl,
k.reply_type replyType,
k.serve_id serveId,
k.serve_type serveType,
bk.classify_id classifyId
FROM
book_keyword bk
JOIN keyword k ON bk.keyword_id = k.id
WHERE
bk.is_delete = 0
AND k.is_delete = 0
AND bk.classify_id = #{classifyId}
AND bk.book_group_id = #{bookGroupId}
AND k.reply_type = 4
<if test="keywordIdList != null and keywordIdList.size>0">
AND k.id NOT IN
<foreach collection = "keywordIdList" index="index" item = "item" open = "(" separator= "," close = ")">
${item}
</foreach>
</if>
GROUP BY
bk.keyword_id
ORDER BY
bk.rank ASC,
bk.update_time DESC,
bk.id DESC
</select>
</mapper> </mapper>
\ No newline at end of file
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