Commit ae0e84fb by 高鹏

Merge branch 'feat-1001733' into 'master'

10017331V1入群优化

See merge request rays/pcloud-book!189
parents 2d7d5307 db50015f
......@@ -558,6 +558,20 @@ public class BookDto extends BaseDto {
*/
private String phone;
/**
* 进群方式:1群二维码,2客服机器人
*/
private Integer joinGroupType;
/**
* 好友人数
*/
private Integer friendsCount;
/**
* 社群码暗号
*/
private String bookGroupCipher;
public String getQrRemark() {
return qrRemark;
}
......@@ -1490,6 +1504,30 @@ public class BookDto extends BaseDto {
this.phone = phone;
}
public Integer getJoinGroupType() {
return joinGroupType;
}
public void setJoinGroupType(Integer joinGroupType) {
this.joinGroupType = joinGroupType;
}
public Integer getFriendsCount() {
return friendsCount;
}
public void setFriendsCount(Integer friendsCount) {
this.friendsCount = friendsCount;
}
public String getBookGroupCipher() {
return bookGroupCipher;
}
public void setBookGroupCipher(String bookGroupCipher) {
this.bookGroupCipher = bookGroupCipher;
}
@Override
public String toString() {
return "BookDto{" +
......@@ -1602,6 +1640,9 @@ public class BookDto extends BaseDto {
", outNum=" + outNum +
", outRate=" + outRate +
", phone='" + phone + '\'' +
'}';
", joinGroupType=" + joinGroupType +
", friendsCount=" + friendsCount +
", bookGroupCipher='" + bookGroupCipher + '\'' +
"} " + super.toString();
}
}
package com.pcloud.book.group.dto;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.pcloud.book.book.dto.BookDto;
import java.io.Serializable;
import java.util.Date;
/**
* 社群书群二维码DTO
* @author PENG
......@@ -120,6 +121,11 @@ public class BookGroupDTO implements Serializable {
private String url;
/**
* 进群方式:1群二维码,2客服机器人
*/
private Integer joinGroupType;
public String getUrl() {
return url;
}
......@@ -290,6 +296,22 @@ public class BookGroupDTO implements Serializable {
this.bookInfo = bookInfo;
}
public Boolean getDelete() {
return isDelete;
}
public void setDelete(Boolean delete) {
isDelete = delete;
}
public Integer getJoinGroupType() {
return joinGroupType;
}
public void setJoinGroupType(Integer joinGroupType) {
this.joinGroupType = joinGroupType;
}
@Override
public String toString() {
return "BookGroupDTO{" +
......@@ -313,6 +335,8 @@ public class BookGroupDTO implements Serializable {
", updateTime=" + updateTime +
", isDelete=" + isDelete +
", bookInfo=" + bookInfo +
"} " + super.toString();
", url='" + url + '\'' +
", joinGroupType=" + joinGroupType +
'}';
}
}
\ No newline at end of file
package com.pcloud.book.group.dto;
import com.pcloud.common.dto.BaseDto;
/**
* @描述:日数量统计
* @作者:zhuyajie
* @创建时间:15:58 2019/9/19
* @版本:1.0
*/
public class DayCountDTO extends BaseDto{
/**
* 日期
*/
private String date;
/**
* 数量
*/
private Integer count;
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
@Override
public String toString() {
return "DayCountDTO{" +
"date='" + date + '\'' +
", count=" + count +
'}';
}
}
package com.pcloud.book.group.enums;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/9/25 15:05
**/
public enum JoinGroupTypeEnum {
/**
* 群二维码
*/
GROUP_QRCODE(1, "群二维码"),
/**
* 客服机器人
*/
ROBOT(2, "客服机器人");
private final Integer code;
private final String name;
public Integer getCode() {
return code;
}
public String getName() {
return name;
}
private JoinGroupTypeEnum(Integer code, String name) {
this.code = code;
this.name = name;
}
}
package com.pcloud.book.group.service;
import java.util.List;
import java.util.Map;
import com.pcloud.book.group.dto.PersonalQrcodeDTO;
import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.dto.GroupCipherDTO;
import com.pcloud.book.group.dto.GroupUseDTO;
import com.pcloud.book.group.dto.PersonalQrcodeDTO;
import com.pcloud.book.group.dto.QueryByBookAdviserDTO;
import com.pcloud.book.group.dto.ResourceBrowseParamDto;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.dto.StoreFlowInfoDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBeanNew;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
/**
......@@ -85,5 +91,18 @@ public interface BookGroupService {
@PostMapping("getResourcesBrowseCount")
ResponseEntity<ResponseDto<Map<Long, Long>>> getResourcesBrowseCount(@RequestBody ResourceBrowseParamDto resourceBrowseParamDto);
@ApiOperation("社群书日加好友人数")
@ApiImplicitParams({
@ApiImplicitParam(name = "bookGroupId", value = "bookGroupId", dataType = "long", paramType = "query"),
@ApiImplicitParam(name = "startDate", value = "开始日期", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "endDate", value = "结束日期", dataType = "string", paramType = "query")
})
@GetMapping("getBookGroupFriendsCountByDay")
ResponseEntity<ResponseDto<Map<String, Integer>>> getBookGroupFriendsCountByDay(
@RequestParam("bookGroupId") Long bookGroupId, @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate);
@ApiOperation("将1v1旧数据的关键词全部都干掉,有应用或作品的挂在社群书配置资源里面")
@GetMapping("dealSelfBookGroupKeywordToServer")
void dealSelfBookGroupKeywordToServer();
}
......@@ -13,10 +13,12 @@ import com.pcloud.wechatgroup.group.dto.RobotReplyDTO;
import com.pcloud.wechatgroup.group.service.GroupMemberService;
import com.pcloud.wechatgroup.message.dto.BrandParamDTO;
import com.pcloud.wechatgroup.message.dto.GroupChatCountDTO;
import com.pcloud.wechatgroup.message.dto.UserChatCountDTO;
import com.pcloud.wechatgroup.message.dto.GroupStatistics;
import com.pcloud.wechatgroup.message.service.MessageService;
import com.pcloud.wechatgroup.monitor.service.MonitorService;
import com.pcloud.wechatgroup.selfrobot.dto.SelfRobotDTO;
import com.pcloud.wechatgroup.selfrobot.dto.UserRobotDTO;
import com.pcloud.wechatgroup.selfrobot.service.SelfRobotService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -360,6 +362,28 @@ public class WechatGroupConsr {
return map;
}
@ParamLog(value = "获取可用机器人")
public SelfRobotDTO getAvailableRobotByBookGroup(Long wechatUserId, Integer largeTemplet, Long bookGroupId) {
SelfRobotDTO selfRobotDTO = null;
try {
selfRobotDTO = ResponseHandleUtil.parseResponse(selfRobotService.getAvailableRobotByBookGroup(wechatUserId, largeTemplet, bookGroupId), SelfRobotDTO.class);
} catch (Exception e) {
log.error("获取可用机器人.[getAvailableRobotByBookGroup]:" + e.getMessage(), e);
}
return selfRobotDTO;
}
@ParamLog("1v1入群-用户基本信息/发言统计")
public Map<String, UserChatCountDTO> getUserChatInfoByUserIdRobotId(List<UserRobotDTO> robotDTOList) {
Map<String, UserChatCountDTO> map = new HashMap<>();
try {
map = ResponseHandleUtil.parseMapResponse(selfRobotService.getUserChatInfoByUserIdRobotId(robotDTOList), String.class, UserChatCountDTO.class);
} catch (Exception e) {
log.error("获取用户基本信息/发言统计失败" + e.getMessage(), e);
}
return map;
}
@ParamLog("获取群消息数量")
public Map<String, GroupStatistics> getGroupMessageStatistics4AdBrand(List<BrandParamDTO> paramDTOList) {
Map<String, GroupStatistics> map = new HashMap<>();
......
package com.pcloud.book.group.biz;
import com.pcloud.book.book.dto.BookDto;
import com.pcloud.book.group.dto.*;
import com.pcloud.book.group.dto.AppStatisticsDTO;
import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.dto.BookGroupStatisticsDTO;
import com.pcloud.book.group.dto.ClassifyKeywordDTO;
import com.pcloud.book.group.dto.GroupCipherDTO;
import com.pcloud.book.group.dto.GroupStoreMyPayDto;
import com.pcloud.book.group.dto.GroupUseDTO;
import com.pcloud.book.group.dto.JoinGroupCipherDTO;
import com.pcloud.book.group.dto.LargeTempletDTO;
import com.pcloud.book.group.dto.OwnAltQrcodeInfoDTO;
import com.pcloud.book.group.dto.PersonalQrcodeDTO;
import com.pcloud.book.group.dto.QrcodeNameAndProIdDTO;
import com.pcloud.book.group.dto.ResourceBrowseParamDto;
import com.pcloud.book.group.entity.BookGroup;
import com.pcloud.book.group.vo.*;
import com.pcloud.book.group.entity.BookGroup;
import com.pcloud.book.group.vo.*;
import com.pcloud.book.group.entity.BookGroupServe;
import com.pcloud.book.group.vo.FriendsVO;
import com.pcloud.book.group.vo.GroupIncomeStaticParamVO;
import com.pcloud.book.group.vo.GroupScanTrendParamVO;
import com.pcloud.book.group.vo.GroupScanTrendVO;
import com.pcloud.book.group.vo.GroupStatisticVO;
import com.pcloud.book.group.vo.ListBookGroup4ChannelParamVO;
import com.pcloud.book.group.vo.ResourcesStatisticVO;
import com.pcloud.book.group.vo.StatisticVO;
import com.pcloud.book.group.vo.TotalRescourceDataVO;
import com.pcloud.book.group.vo.WxGroupStatisticVO;
import com.pcloud.common.dto.StoreFlowInfoDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBean;
......@@ -281,6 +291,11 @@ public interface BookGroupBiz {
void deleteBookGroup(Long bookGroupId);
/**
* 根据社群码id获取个人二维码信息
*/
OwnAltQrcodeInfoDTO getOwnAltQrcodeInfoDTOByBookGroupId(Long wechatUserId, Long bookGroupId);
/**
* 根据分类id获取个人二维码信息
*/
OwnAltQrcodeInfoDTO getOwnAltQrcodeInfoDTOByClassifyId(Long wechatUserId, Long classifyId);
......@@ -379,6 +394,59 @@ public interface BookGroupBiz {
*/
Map<Long, Long> getResourcesBrowseCount(ResourceBrowseParamDto resourceBrowseParamDto);
/**
*日加好友人数
* @param bookGroupId
* @param startDate
* @param endDate
* @return
*/
Map<String, Integer> getBookGroupFriendsCountByDay(Long bookGroupId, String startDate, String endDate);
/**
* 好友数据统计列表
* @param bookGroupId
* @return
*/
PageBeanNew<FriendsVO> listPageFriendsStatistic(Long bookGroupId, Integer currentPage, Integer numPerPage);
/**
* 批量新增资源配置
*
* @param partyId
* @param bookGroupServes
*/
void batchAddBookGroupServe(Long partyId, List<BookGroupServe> bookGroupServes);
/**
* 删除资源配置
*
* @param id
*/
void deleteBookGroupServe(Long id);
/**
* 获取资源配置集合
*
* @param bookGroupId
* @return
*/
List<BookGroupServe> getBookGroupServeList(Long bookGroupId);
/**
* 获取社群码暗号
*/
String getBookGroupCipher();
/**
* 批量更新资源配置
* @param partyId
* @param bookGroupServes
*/
void batchUpdateBookGroupServe(Long partyId, List<BookGroupServe> bookGroupServes);
/**
* 将1v1旧数据的关键词全部都干掉,有应用或作品的挂在社群书配置资源里面
*/
void dealSelfBookGroupKeywordToServer();
}
......@@ -17,6 +17,7 @@ import com.pcloud.book.group.biz.GroupAnnouncementBiz;
import com.pcloud.book.group.biz.GroupQrcodeBiz;
import com.pcloud.book.group.biz.WeixinQrcodeBiz;
import com.pcloud.book.group.dao.BookClassifyBuyRecordDao;
import com.pcloud.book.group.dao.BookGroupCipherUserDao;
import com.pcloud.book.group.dao.BookGroupClassifyDao;
import com.pcloud.book.group.dao.BookGroupDao;
import com.pcloud.book.group.dao.BookQrcodeUserDao;
......@@ -162,10 +163,11 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
private LearningReportTouchRecordDao learningReportTouchRecordDao;
@Autowired
private JoinGroupCipherDao joinGroupCipherDao;
@Autowired
private BookAuthUserBiz bookAuthUserBiz;
@Autowired
private BookGroupCipherUserDao bookGroupCipherUserDao;
@Autowired
private BookGroupDao bookGroupDao;
......@@ -489,6 +491,8 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
classifyAndGroupCountVO.setClassifyCount(statistic.get(bookGroupId).getClassifyCount());
}
classifyAndGroupCountVO.setGroupCount(groupCount);
Integer friendsCount = bookGroupCipherUserDao.getFriendsCountByBookGroup(bookGroupId);
classifyAndGroupCountVO.setFriendsCount(friendsCount);
return classifyAndGroupCountVO;
}
......
package com.pcloud.book.group.dao;
import com.pcloud.book.group.dto.DayCountDTO;
import com.pcloud.book.group.entity.BookGroupCipherUser;
import com.pcloud.common.core.dao.BaseDao;
import java.util.List;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/9/24 15:18
**/
public interface BookGroupCipherUserDao extends BaseDao<BookGroupCipherUser> {
Long getBookGroupIdByWxUserId(String wxUserId);
/**
* 社群码好友数量
* @param bookGroupId
* @return
*/
public Integer getFriendsCountByBookGroup(Long bookGroupId);
/**
* 日加好友数量
* @param bookGroupId
* @param startTime
* @param endTime
* @return
*/
List<DayCountDTO> getBookGroupFriendsCountByDay(Long bookGroupId, String startTime, String endTime);
}
......@@ -263,4 +263,5 @@ public interface BookGroupClassifyDao extends BaseDao<BookGroupClassify> {
List<ListClassifyVO> getClassifyIngoreDelete(Long bookGroupId);
List<BookGroupClassify> getListByBookGroupId(Long bookGroupId);
}
......@@ -155,4 +155,30 @@ public interface BookGroupDao extends BaseDao<BookGroup> {
* 删除社群书
*/
void deleteByBookGroupId(Long bookGroupId);
/**
* 根据社群码id获取社群书基本信息(包括书籍封面isbn号)
* @param bookGroupId
* @return
*/
BookGroupDTO getBookBaseInfoById(Long bookGroupId);
/**
* 编辑社群书好友人数
* @param adviserId
* @return
*/
public Integer getBookGroupFriendsCountByAdviser(Long adviserId);
/**
* 根据社群码暗号获取社群码
* @param bookGroupCipher
* @return
*/
BookGroup getByBookGroupCipher(String bookGroupCipher);
/**
* 根据入群方式查询社群书集合
*/
List<BookGroup> getBookGroupByJoinGroupType(Integer joinGroupType);
}
package com.pcloud.book.group.dao;
import com.pcloud.book.group.entity.BookGroupServe;
import com.pcloud.common.core.dao.BaseDao;
import java.util.List;
public interface BookGroupServeDao extends BaseDao<BookGroupServe> {
Integer batchInsert(List<BookGroupServe> bookGroupServes);
List<BookGroupServe> getListByBookGroupId(Long bookGroupId);
void deleteByBookGroupId(Long bookGroupId);
}
......@@ -263,5 +263,7 @@ public interface GroupQrcodeDao extends BaseDao<GroupQrcode> {
List<ClassifyQrcodeVO> getQrcodeByClassifyId(Long classifyId);
List<GroupQrcode> getListByBookGroupIds(List<Long> bookGroupIds);
Map<Long, GroupQrcodeInfo4Advertising> getWechatGroupInfoMap(List<Long> qrcodeIds);
}
package com.pcloud.book.group.dao;
import com.pcloud.book.group.dto.DayCountDTO;
import com.pcloud.book.group.dto.JoinGroupCipherDTO;
import com.pcloud.book.group.entity.JoinGroupCipher;
import com.pcloud.common.core.dao.BaseDao;
......@@ -28,6 +29,12 @@ public interface JoinGroupCipherDao extends BaseDao<JoinGroupCipher> {
*/
BigDecimal getPayPrice(String wxId, Long qrcodeId);
JoinGroupCipher getByCondition(Long wechatUserId, Long bookGroupId, Integer type);
List<JoinGroupCipher> getListByAltIdAndWxIdAndType(String robotId, String userWxId, Integer code);
JoinGroupCipher getByWechatUserIdAndQrcodeId(Long wechatUserId, Long qrcodeId, Integer type);
void updateCipher(Long id, String cipher);
......
package com.pcloud.book.group.dao.impl;
import com.pcloud.book.group.dao.BookGroupCipherUserDao;
import com.pcloud.book.group.dto.DayCountDTO;
import com.pcloud.book.group.entity.BookGroupCipherUser;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/9/24 15:19
**/
@Component("bookGroupCipherUserDao")
public class BookGroupCipherUserDaoImpl extends BaseDaoImpl<BookGroupCipherUser> implements BookGroupCipherUserDao {
@Override
public Long getBookGroupIdByWxUserId(String wxUserId) {
return this.getSqlSession().selectOne(this.getStatement("getBookGroupIdByWxUserId"), wxUserId);
}
@Override
public Integer getFriendsCountByBookGroup(Long bookGroupId) {
return getSessionTemplate().selectOne(getStatement("getFriendsCountByBookGroup"), bookGroupId);
}
@Override
public List<DayCountDTO> getBookGroupFriendsCountByDay(Long bookGroupId, String startTime, String endTime) {
Map<String, Object> map = new HashMap<>();
map.put("bookGroupId", bookGroupId);
map.put("startTime", startTime);
map.put("endTime", endTime);
return getSessionTemplate().selectList(getStatement("getBookGroupFriendsCountByDay"), map);
}
}
......@@ -248,4 +248,9 @@ public class BookGroupClassifyDaoImpl extends BaseDaoImpl<BookGroupClassify> imp
public List<ListClassifyVO> getClassifyIngoreDelete(Long bookGroupId) {
return this.getSqlSession().selectList(this.getStatement("getClassifyIngoreDelete"), bookGroupId);
}
@Override
public List<BookGroupClassify> getListByBookGroupId(Long bookGroupId) {
return this.getSqlSession().selectList(this.getStatement("getListByBookGroupId"), bookGroupId);
}
}
package com.pcloud.book.group.dao.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.pcloud.book.group.dto.PersonalQrcodeDTO;
import org.springframework.stereotype.Repository;
import com.pcloud.book.group.dao.BookGroupDao;
import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.dto.PersonalQrcodeDTO;
import com.pcloud.book.group.dto.QrcodeNameAndProIdDTO;
import com.pcloud.book.group.entity.BookGroup;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Repository;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Description 社群书群二维码数据访问层接口实现类
* Created by PENG on 2019/4/17.
......@@ -165,4 +166,24 @@ public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGrou
paramMap.put("bookGroupId", bookGroupId);
super.getSqlSession().update(getStatement("deleteByBookGroupId"), paramMap);
}
@Override
public BookGroupDTO getBookBaseInfoById(Long bookGroupId) {
return this.getSqlSession().selectOne(this.getStatement("getBookBaseInfoById"), bookGroupId);
}
@Override
public Integer getBookGroupFriendsCountByAdviser(Long adviserId) {
return this.getSqlSession().selectOne(getStatement("getBookGroupFriendsCountByAdviser"), adviserId);
}
@Override
public BookGroup getByBookGroupCipher(String bookGroupCipher) {
return this.getSqlSession().selectOne(getStatement("getByBookGroupCipher"), bookGroupCipher);
}
@Override
public List<BookGroup> getBookGroupByJoinGroupType(Integer joinGroupType) {
return this.getSqlSession().selectList(getStatement("getBookGroupByJoinGroupType"), joinGroupType);
}
}
package com.pcloud.book.group.dao.impl;
import com.pcloud.book.group.dao.BookGroupServeDao;
import com.pcloud.book.group.entity.BookGroupServe;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/9/23 15:39
**/
@Component("bookGroupServeDao")
public class BookGroupServeDaoImpl extends BaseDaoImpl<BookGroupServe> implements BookGroupServeDao {
@Override
public Integer batchInsert(List<BookGroupServe> list) {
return super.getSqlSession().insert(getStatement("batchInsert"), list);
}
@Override
public List<BookGroupServe> getListByBookGroupId(Long bookGroupId) {
return super.getSqlSession().selectList(getStatement("getListByBookGroupId"), bookGroupId);
}
@Override
public void deleteByBookGroupId(Long bookGroupId) {
super.getSqlSession().delete(getStatement("deleteByBookGroupId"), bookGroupId);
}
}
......@@ -244,6 +244,11 @@ public class GroupQrcodeDaoImpl extends BaseDaoImpl<GroupQrcode> implements Grou
}
@Override
public List<GroupQrcode> getListByBookGroupIds(List<Long> bookGroupIds) {
return this.getSqlSession().selectList(this.getStatement("getListByBookGroupIds"), bookGroupIds);
}
@Override
public Map<Long, GroupQrcodeInfo4Advertising> getWechatGroupInfoMap(List<Long> qrcodeIds) {
return this.getSqlSession().selectMap(this.getStatement("getWechatGroupInfoMap"), qrcodeIds,"groupQrcodeId");
}
......
package com.pcloud.book.group.dao.impl;
import com.pcloud.book.group.dao.JoinGroupCipherDao;
import com.pcloud.book.group.dto.DayCountDTO;
import com.pcloud.book.group.dto.JoinGroupCipherDTO;
import com.pcloud.book.group.entity.JoinGroupCipher;
import com.pcloud.common.core.dao.BaseDaoImpl;
......@@ -71,6 +72,23 @@ public class JoinGroupCipherDaoImpl extends BaseDaoImpl<JoinGroupCipher> impleme
}
@Override
public JoinGroupCipher getByCondition(Long wechatUserId, Long bookGroupId, Integer type) {
Map<String,Object> map=new HashMap<>();
map.put("wechatUserId",wechatUserId);
map.put("bookGroupId",bookGroupId);
map.put("type",type);
return this.getSqlSession().selectOne(this.getStatement("getByCondition"), map);
}
@Override
public List<JoinGroupCipher> getListByAltIdAndWxIdAndType(String robotId, String userWxId, Integer type) {
Map<String,Object> map=new HashMap<>();
map.put("robotId",robotId);
map.put("userWxId",userWxId);
map.put("type",type);
return this.getSqlSession().selectList(this.getStatement("getListByAltIdAndWxIdAndType"), map);
}
public JoinGroupCipher getByWechatUserIdAndQrcodeId(Long wechatUserId, Long qrcodeId, Integer type) {
Map<String,Object> map=new HashMap<>();
map.put("wechatUserId",wechatUserId);
......
......@@ -152,6 +152,26 @@ public class BookGroupDTO extends BaseDto {
*/
private Integer joinGroupType;
/**
* 加好友欢迎语
*/
private String addFriendGuide;
/**
* 客服称谓
*/
private String customerServiceName;
/**
* 是否邀请入群
*/
private Boolean isInviteGroup;
/**
* 社群书暗号
*/
private String bookGroupCipher;
public String getUrl() {
return url;
}
......@@ -386,6 +406,38 @@ public class BookGroupDTO extends BaseDto {
this.bookNumber = bookNumber;
}
public String getAddFriendGuide() {
return addFriendGuide;
}
public void setAddFriendGuide(String addFriendGuide) {
this.addFriendGuide = addFriendGuide;
}
public String getCustomerServiceName() {
return customerServiceName;
}
public void setCustomerServiceName(String customerServiceName) {
this.customerServiceName = customerServiceName;
}
public Boolean getIsInviteGroup() {
return isInviteGroup;
}
public void setIsInviteGroup(Boolean isInviteGroup) {
this.isInviteGroup = isInviteGroup;
}
public String getBookGroupCipher() {
return bookGroupCipher;
}
public void setBookGroupCipher(String bookGroupCipher) {
this.bookGroupCipher = bookGroupCipher;
}
@Override
public String toString() {
return "BookGroupDTO{" +
......@@ -418,8 +470,10 @@ public class BookGroupDTO extends BaseDto {
", bookClockInfoId=" + bookClockInfoId +
", isShowBookName=" + isShowBookName +
", joinGroupType=" + joinGroupType +
", addFriendGuide='" + addFriendGuide + '\'' +
", customerServiceName='" + customerServiceName + '\'' +
", isInviteGroup=" + isInviteGroup +
", bookGroupCipher='" + bookGroupCipher + '\'' +
"} " + super.toString();
}
}
\ No newline at end of file
......@@ -28,6 +28,12 @@ public class OwnAltQrcodeInfoDTO implements Serializable {
@ApiModelProperty("暗号")
private String cipher;
@ApiModelProperty("客服称谓")
private String customerServiceName;
@ApiModelProperty("加好友宣传语")
private String addFriendGuide;
public String getAltId() {
return altId;
}
......@@ -68,6 +74,22 @@ public class OwnAltQrcodeInfoDTO implements Serializable {
this.cipher = cipher;
}
public String getCustomerServiceName() {
return customerServiceName;
}
public void setCustomerServiceName(String customerServiceName) {
this.customerServiceName = customerServiceName;
}
public String getAddFriendGuide() {
return addFriendGuide;
}
public void setAddFriendGuide(String addFriendGuide) {
this.addFriendGuide = addFriendGuide;
}
@Override
public String toString() {
return "OwnAltQrcodeInfoDTO{" +
......@@ -76,6 +98,8 @@ public class OwnAltQrcodeInfoDTO implements Serializable {
", altHeadUrl='" + altHeadUrl + '\'' +
", altQrcodeUrl='" + altQrcodeUrl + '\'' +
", cipher='" + cipher + '\'' +
", customerServiceName='" + customerServiceName + '\'' +
", addFriendGuide='" + addFriendGuide + '\'' +
'}';
}
}
......@@ -107,6 +107,26 @@ public class BookGroup extends BaseEntity {
*/
private Integer joinGroupType;
/**
* 加好友欢迎语
*/
private String addFriendGuide;
/**
* 客服称谓
*/
private String customerServiceName;
/**
* 是否邀请入群
*/
private Boolean isInviteGroup;
/**
* 社群书暗号
*/
private String bookGroupCipher;
public Long getId() {
return id;
}
......@@ -259,6 +279,38 @@ public class BookGroup extends BaseEntity {
this.joinGroupType = joinGroupType;
}
public String getAddFriendGuide() {
return addFriendGuide;
}
public void setAddFriendGuide(String addFriendGuide) {
this.addFriendGuide = addFriendGuide;
}
public String getCustomerServiceName() {
return customerServiceName;
}
public void setCustomerServiceName(String customerServiceName) {
this.customerServiceName = customerServiceName;
}
public Boolean getIsInviteGroup() {
return isInviteGroup;
}
public void setIsInviteGroup(Boolean isInviteGroup) {
this.isInviteGroup = isInviteGroup;
}
public String getBookGroupCipher() {
return bookGroupCipher;
}
public void setBookGroupCipher(String bookGroupCipher) {
this.bookGroupCipher = bookGroupCipher;
}
@Override
public String toString() {
return "BookGroup{" +
......@@ -281,6 +333,10 @@ public class BookGroup extends BaseEntity {
", isDelete=" + isDelete +
", isShowBookName=" + isShowBookName +
", joinGroupType=" + joinGroupType +
", addFriendGuide='" + addFriendGuide + '\'' +
", customerServiceName='" + customerServiceName + '\'' +
", isInviteGroup=" + isInviteGroup +
", bookGroupCipher='" + bookGroupCipher + '\'' +
"} " + super.toString();
}
}
\ No newline at end of file
package com.pcloud.book.group.entity;
import com.pcloud.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/9/24 15:16
**/
@ApiModel("社群书暗号关联用户")
public class BookGroupCipherUser extends BaseEntity {
private static final long serialVersionUID = 1763812276337850708L;
@ApiModelProperty("社群码id")
private Long bookGroupId;
@ApiModelProperty("社群码暗号")
private String bookGroupCipher;
@ApiModelProperty("用户微信id")
private String wxUserId;
@ApiModelProperty("机器人id")
private String altId;
public Long getBookGroupId() {
return bookGroupId;
}
public void setBookGroupId(Long bookGroupId) {
this.bookGroupId = bookGroupId;
}
public String getBookGroupCipher() {
return bookGroupCipher;
}
public void setBookGroupCipher(String bookGroupCipher) {
this.bookGroupCipher = bookGroupCipher;
}
public String getWxUserId() {
return wxUserId;
}
public void setWxUserId(String wxUserId) {
this.wxUserId = wxUserId;
}
public String getAltId() {
return altId;
}
public void setAltId(String altId) {
this.altId = altId;
}
@Override
public String toString() {
return "BookGroupCipherUser{" +
"bookGroupId=" + bookGroupId +
", bookGroupCipher='" + bookGroupCipher + '\'' +
", wxUserId='" + wxUserId + '\'' +
", altId='" + altId + '\'' +
"} " + super.toString();
}
}
package com.pcloud.book.group.entity;
import com.pcloud.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/9/23 15:35
**/
public class BookGroupServe extends BaseEntity {
private static final long serialVersionUID = 7725930392678110441L;
@ApiModelProperty("作品或应用id")
private Long serveId;
@ApiModelProperty("类型;APP应用,PRODUCT作品")
private String serveType;
@ApiModelProperty("链接")
private String serveUrl;
@ApiModelProperty("短链")
private String shortUrl;
@ApiModelProperty("社群书id")
private Long bookGroupId;
@ApiModelProperty("创建人")
private Long createUser;
@ApiModelProperty("应用或作品名称")
private String serveName;
@ApiModelProperty("类型")
private String fromType;
@ApiModelProperty("是否超级作者")
private Boolean isSuper;
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();
}
}
......@@ -14,6 +14,9 @@ public class JoinGroupCipher extends BaseEntity {
@ApiModelProperty("密码")
private String cipher;
@ApiModelProperty("社群码id")
private Long bookGroupId;
@ApiModelProperty("分类id")
private Long classifyId;
......@@ -43,6 +46,14 @@ public class JoinGroupCipher extends BaseEntity {
this.cipher = cipher;
}
public Long getBookGroupId() {
return bookGroupId;
}
public void setBookGroupId(Long bookGroupId) {
this.bookGroupId = bookGroupId;
}
public Long getClassifyId() {
return classifyId;
}
......@@ -103,6 +114,7 @@ public class JoinGroupCipher extends BaseEntity {
public String toString() {
return "JoinGroupCipher{" +
"cipher='" + cipher + '\'' +
", bookGroupId=" + bookGroupId +
", classifyId=" + classifyId +
", qrcodeId=" + qrcodeId +
", wechatUserId=" + wechatUserId +
......
package com.pcloud.book.group.facade;
import com.pcloud.book.group.entity.BookGroup;
import com.pcloud.book.group.entity.BookGroupClassify;
import com.pcloud.book.group.vo.*;
import com.pcloud.book.group.entity.BookGroupServe;
import com.pcloud.book.group.vo.FriendsVO;
import com.pcloud.book.group.vo.GroupIncomeStaticParamVO;
import com.pcloud.book.group.vo.GroupScanTrendParamVO;
import com.pcloud.book.group.vo.GroupScanTrendVO;
import com.pcloud.book.group.vo.ListBookGroup4ChannelParamVO;
import com.pcloud.book.group.vo.ResourcesStatisticVO;
import com.pcloud.book.group.vo.UpdateRankTypeVO;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBean;
import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.permission.PermissionException;
import org.codehaus.jackson.JsonParseException;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -14,20 +26,14 @@ import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import com.pcloud.book.group.entity.BookGroup;
import com.pcloud.book.group.vo.ListBookGroup4ChannelParamVO;
import com.pcloud.book.group.vo.UpdateRankTypeVO;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBean;
import com.pcloud.common.permission.PermissionException;
import java.util.List;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import java.util.List;
/**
* Description 社群书群二维码接口
* Created by PENG on 2019/4/17.
......@@ -289,6 +295,13 @@ public interface BookGroupFacade {
) throws BizException, PermissionException, JsonParseException;
@ApiOperation("根据分类id获取个人二维码")
@GetMapping("getOwnAltQrcodeInfoDTOByBookGroupId")
ResponseDto<?> getOwnAltQrcodeInfoDTOByBookGroupId(
@CookieValue("userInfo") String userInfo,
@RequestParam("bookGroupId") Long bookGroupId
) throws BizException, PermissionException, JsonParseException;
@ApiOperation("根据分类id获取个人二维码")
@GetMapping("getOwnAltQrcodeInfoDTOByClassifyId")
ResponseDto<?> getOwnAltQrcodeInfoDTOByClassifyId(
@CookieValue("userInfo") String userInfo,
......@@ -371,6 +384,49 @@ public interface BookGroupFacade {
public ResponseDto<?> exportRescourceIncomeData(@RequestHeader("token") String token,
@RequestParam(value = "bookGroupId",required = true) Long bookGroupId) throws BizException, PermissionException;
@ApiOperation(value = "用户发言数据列表--1v1入群", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "bookGroupId", value = "bookGroupId", required = true, dataType = "Long", paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "currentPage", required = true, dataType = "Integer", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "numPerPage", required = true, dataType = "Integer", paramType = "query")
})
@GetMapping("listPageFriendsStatistic")
public ResponseDto<PageBeanNew<FriendsVO>> listPageFriendsStatistic(
@RequestHeader("token") String token, @RequestParam(value = "bookGroupId", required = true) Long bookGroupId,
@RequestParam(value = "currentPage", required = true) Integer currentPage,
@RequestParam(value = "numPerPage", required = true) Integer numPerPage) throws BizException, PermissionException;
@ApiOperation("批量新增资源配置")
@PostMapping("batchAddBookGroupServe")
ResponseDto<?> batchAddBookGroupServe(
@RequestHeader("token") String token,
@RequestBody List<BookGroupServe> bookGroupServes
) throws BizException, PermissionException, JsonParseException;
@ApiOperation("批量更新资源配置")
@PostMapping("batchUpdateBookGroupServe")
ResponseDto<?> batchUpdateBookGroupServe(
@RequestHeader("token") String token,
@RequestBody List<BookGroupServe> bookGroupServes
) throws BizException, PermissionException, JsonParseException;
@ApiOperation("删除资源配置")
@GetMapping("deleteBookGroupServe")
ResponseDto<?> deleteBookGroupServe(
@RequestHeader("token") String token,
@RequestParam("id") Long id
) throws BizException, PermissionException, JsonParseException;
@ApiOperation("获取资源配置集合")
@GetMapping("getBookGroupServeList")
ResponseDto<?> getBookGroupServeList(
@RequestHeader("token") String token,
@RequestParam("bookGroupId") Long bookGroupId
) throws BizException, PermissionException, JsonParseException;
@ApiOperation("获取社群码暗号")
@GetMapping("getBookGroupCipher")
ResponseDto<?> getBookGroupCipher(
@RequestHeader("token") String token
) throws BizException, PermissionException, JsonParseException;
}
......@@ -6,8 +6,18 @@ import com.pcloud.book.group.biz.BookGroupClassifyBiz;
import com.pcloud.book.group.dto.GroupStoreMyPayDto;
import com.pcloud.book.group.entity.BookGroup;
import com.pcloud.book.group.entity.BookGroupClassify;
import com.pcloud.book.group.entity.BookGroupServe;
import com.pcloud.book.group.facade.BookGroupFacade;
import com.pcloud.book.group.vo.*;
import com.pcloud.book.group.vo.FriendsVO;
import com.pcloud.book.group.vo.GroupIncomeStaticParamVO;
import com.pcloud.book.group.vo.GroupScanTrendParamVO;
import com.pcloud.book.group.vo.GroupScanTrendVO;
import com.pcloud.book.group.vo.GroupStatisticVO;
import com.pcloud.book.group.vo.ListBookGroup4ChannelParamVO;
import com.pcloud.book.group.vo.ResourcesStatisticVO;
import com.pcloud.book.group.vo.TotalRescourceDataVO;
import com.pcloud.book.group.vo.UpdateRankTypeVO;
import com.pcloud.book.group.vo.WxGroupStatisticVO;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBean;
......@@ -17,9 +27,9 @@ import com.pcloud.common.permission.PermissionException;
import com.pcloud.common.utils.SessionUtil;
import com.pcloud.common.utils.cookie.Cookie;
import com.pcloud.common.utils.string.StringUtil;
import org.codehaus.jackson.JsonParseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -410,6 +420,20 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
return new ResponseDto<>();
}
@ApiOperation("根据社群书id获取个人二维码")
@GetMapping("getOwnAltQrcodeInfoDTOByBookGroupId")
@Override
public ResponseDto<?> getOwnAltQrcodeInfoDTOByBookGroupId(
@CookieValue("userInfo") String userInfo,
@RequestParam("bookGroupId") Long bookGroupId
) throws BizException, PermissionException, JsonParseException {
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
if (bookGroupId == null) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "社群码id不能为空!");
}
return new ResponseDto<>(bookGroupBiz.getOwnAltQrcodeInfoDTOByBookGroupId(wechatUserId, bookGroupId));
}
@ApiOperation("根据分类id获取个人二维码")
@GetMapping("getOwnAltQrcodeInfoDTOByClassifyId")
@Override
......@@ -519,4 +543,72 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
}
@Override
@GetMapping("listPageFriendsStatistic")
public ResponseDto<PageBeanNew<FriendsVO>> listPageFriendsStatistic(
@RequestHeader("token") String token, @RequestParam(value = "bookGroupId", required = true) Long bookGroupId,
@RequestParam(value = "currentPage", required = true) Integer currentPage,
@RequestParam(value = "numPerPage", required = true) Integer numPerPage) throws BizException, PermissionException {
SessionUtil.getToken4Redis(token);
PageBeanNew<FriendsVO> pageBeanNew = bookGroupBiz.listPageFriendsStatistic(bookGroupId, currentPage, numPerPage);
return new ResponseDto<>(pageBeanNew);
}
@ApiOperation("批量新增资源配置")
@PostMapping("batchAddBookGroupServe")
@Override
public ResponseDto<?> batchAddBookGroupServe(
@RequestHeader("token") String token,
@RequestBody List<BookGroupServe> bookGroupServes
) throws BizException, PermissionException, JsonParseException {
Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
bookGroupBiz.batchAddBookGroupServe(partyId, bookGroupServes);
return new ResponseDto<>();
}
@ApiOperation("批量更新资源配置")
@PostMapping("batchUpdateBookGroupServe")
@Override
public ResponseDto<?> batchUpdateBookGroupServe(
@RequestHeader("token") String token,
@RequestBody List<BookGroupServe> bookGroupServes
) throws BizException, PermissionException, JsonParseException {
Long partyId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
bookGroupBiz.batchUpdateBookGroupServe(partyId, bookGroupServes);
return new ResponseDto<>();
}
@ApiOperation("删除资源配置")
@GetMapping("deleteBookGroupServe")
@Override
public ResponseDto<?> deleteBookGroupServe(
@RequestHeader("token") String token,
@RequestParam("id") Long id
) throws BizException, PermissionException, JsonParseException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
bookGroupBiz.deleteBookGroupServe(id);
return new ResponseDto<>();
}
@ApiOperation("获取资源配置集合")
@GetMapping("getBookGroupServeList")
@Override
public ResponseDto<?> getBookGroupServeList(
@RequestHeader("token") String token,
@RequestParam("bookGroupId") Long bookGroupId
) throws BizException, PermissionException, JsonParseException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(bookGroupBiz.getBookGroupServeList(bookGroupId));
}
@ApiOperation("获取社群码暗号")
@GetMapping("getBookGroupCipher")
@Override
public ResponseDto<?> getBookGroupCipher(
@RequestHeader("token") String token
) throws BizException, PermissionException, JsonParseException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(bookGroupBiz.getBookGroupCipher());
}
}
package com.pcloud.book.group.service.impl;
import java.util.List;
import java.util.Map;
import com.pcloud.book.group.dto.PersonalQrcodeDTO;
import com.pcloud.book.group.biz.BookGroupBiz;
import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.dto.GroupCipherDTO;
import com.pcloud.book.group.dto.GroupUseDTO;
import io.swagger.annotations.ApiOperation;
import com.pcloud.book.group.dto.PersonalQrcodeDTO;
import com.pcloud.book.group.dto.QueryByBookAdviserDTO;
import com.pcloud.book.group.dto.ResourceBrowseParamDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.pcloud.book.group.biz.BookGroupBiz;
import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.service.BookGroupService;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.dto.StoreFlowInfoDto;
......@@ -22,6 +15,21 @@ import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.utils.ResponseHandleUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
import io.swagger.annotations.ApiOperation;
/**
* Description 社群书内部接口实现类
* Created by PENG on 2019/5/14.
......@@ -152,7 +160,20 @@ public class BookGroupServiceImpl implements BookGroupService {
@PostMapping("getResourcesBrowseCount")
public ResponseEntity<ResponseDto<Map<Long, Long>>> getResourcesBrowseCount(@RequestBody ResourceBrowseParamDto resourceBrowseParamDto) {
return ResponseHandleUtil.toResponse(bookGroupBiz.getResourcesBrowseCount(resourceBrowseParamDto));
}
@GetMapping("getBookGroupFriendsCountByDay")
public ResponseEntity<ResponseDto<Map<String, Integer>>> getBookGroupFriendsCountByDay(
@RequestParam("bookGroupId") Long bookGroupId, @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate) {
Map<String, Integer> map = bookGroupBiz.getBookGroupFriendsCountByDay(bookGroupId, startDate, endDate);
return ResponseHandleUtil.toResponse(map);
}
@ApiOperation("将1v1旧数据的关键词全部都干掉,有应用或作品的挂在社群书配置资源里面")
@GetMapping("dealSelfBookGroupKeywordToServer")
@Override
public void dealSelfBookGroupKeywordToServer() {
bookGroupBiz.dealSelfBookGroupKeywordToServer();
}
}
......@@ -24,6 +24,9 @@ public class ClassifyAndGroupCountVO implements Serializable {
@ApiModelProperty("群数量")
private Integer groupCount;
@ApiModelProperty("好友人数")
private Integer friendsCount;
public Long getBookGroupId() {
return bookGroupId;
}
......@@ -48,12 +51,21 @@ public class ClassifyAndGroupCountVO implements Serializable {
this.groupCount = groupCount;
}
public Integer getFriendsCount() {
return friendsCount;
}
public void setFriendsCount(Integer friendsCount) {
this.friendsCount = friendsCount;
}
@Override
public String toString() {
return "ClassifyAndGroupCountVO{" +
"bookGroupId=" + bookGroupId +
", classifyCount=" + classifyCount +
", groupCount=" + groupCount +
", friendsCount=" + friendsCount +
'}';
}
}
package com.pcloud.book.group.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.pcloud.common.dto.BaseDto;
import java.util.Date;
/**
* @描述:好友用户信息
* @作者:zhuyajie
* @创建时间:11:51 2019/9/20
* @版本:1.0
*/
public class FriendsVO extends BaseDto {
/**
* 机器人id
*/
private String robotId;
/**
* 微信用户ID
*/
private String wxUserId;
/**
* 昵称
*/
private String nickName;
/**
* 头像
*/
private String headPic;
/**
* 性别
*/
private Integer sex;
/**
* 国家
*/
private String country;
/**
* 省份
*/
private String province;
/**
* 城市
*/
private String city;
/**
* 添加时间
*/
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss",
timezone = "GMT+8"
)
private Date createTime;
/**
* 状态
*/
private String state;
/**
* 累积发言次数
*/
private Integer speakCount;
/**
* 7天累积发言次数
*/
private Integer speakCountLast7;
/**
* 最后一次发言时间
*/
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss",
timezone = "GMT+8"
)
private Date lastSpeakTime;
public String getRobotId() {
return robotId;
}
public void setRobotId(String robotId) {
this.robotId = robotId;
}
public String getWxUserId() {
return wxUserId;
}
public void setWxUserId(String wxUserId) {
this.wxUserId = wxUserId;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getHeadPic() {
return headPic;
}
public void setHeadPic(String headPic) {
this.headPic = headPic;
}
public Integer getSex() {
return sex;
}
public void setSex(Integer sex) {
this.sex = sex;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public Integer getSpeakCount() {
return speakCount;
}
public void setSpeakCount(Integer speakCount) {
this.speakCount = speakCount;
}
public Integer getSpeakCountLast7() {
return speakCountLast7;
}
public void setSpeakCountLast7(Integer speakCountLast7) {
this.speakCountLast7 = speakCountLast7;
}
public Date getLastSpeakTime() {
return lastSpeakTime;
}
public void setLastSpeakTime(Date lastSpeakTime) {
this.lastSpeakTime = lastSpeakTime;
}
@Override
public String toString() {
return "FriendsVO{" +
"robotId='" + robotId + '\'' +
", wxUserId='" + wxUserId + '\'' +
", nickName='" + nickName + '\'' +
", headPic='" + headPic + '\'' +
", sex=" + sex +
", country='" + country + '\'' +
", province='" + province + '\'' +
", city='" + city + '\'' +
", createTime=" + createTime +
", state='" + state + '\'' +
", speakCount=" + speakCount +
", speakCountLast7=" + speakCountLast7 +
", lastSpeakTime=" + lastSpeakTime +
'}';
}
}
......@@ -36,6 +36,9 @@ public class GroupQrcode4ClassifyVO implements Serializable {
@ApiModelProperty("分类名称")
private String classify;
@ApiModelProperty("微信群名称")
private String weixinGroupId;
public String getClassify() {
return classify;
}
......@@ -92,6 +95,14 @@ public class GroupQrcode4ClassifyVO implements Serializable {
this.spareQr = spareQr;
}
public String getWeixinGroupId() {
return weixinGroupId;
}
public void setWeixinGroupId(String weixinGroupId) {
this.weixinGroupId = weixinGroupId;
}
@Override
public String toString() {
return "GroupQrcode4ClassifyVO{" +
......@@ -102,6 +113,7 @@ public class GroupQrcode4ClassifyVO implements Serializable {
", groupQrcodeId=" + groupQrcodeId +
", spareQr='" + spareQr + '\'' +
", classify='" + classify + '\'' +
", weixinGroupId='" + weixinGroupId + '\'' +
'}';
}
}
......@@ -125,4 +125,10 @@ public interface BookKeywordBiz {
*/
List<ServiceResourceDTO> getServiceByChannel(QrWeixinParam qrWeixinParam, Long wechatUserId);
/**
* 根据社群码id获取关键词列表
* @param bookGroupId
* @return
*/
List<KeywordDTO> getListByBookGroupId(Long bookGroupId);
}
......@@ -115,6 +115,18 @@ public class BookGuideBizImpl implements BookGuideBiz {
return;
}
String cipher = agreeAddUserDTO.getCipher();
//如果暗号为空,表示直接加好友,需要发送统一欢迎语
if (cipher == null) {
SendTextMessageVO vo = new SendTextMessageVO();
vo.setContent("你好,请将书的专属暗号发给我!可以在扫码后的页面上复制,也可以在书上印码位置处找到。");
vo.setCode(SendMessageTypeEnum.SELF.getCode());
vo.setWxId(agreeAddUserDTO.getRobotWxId());
vo.setAltId(agreeAddUserDTO.getRobotWxId());
vo.setWxGroupId(agreeAddUserDTO.getUserWxId());
vo.setIp(agreeAddUserDTO.getIp());
WxGroupSDK.sendTextMessage(vo);
return;
}
if (StringUtil.isBlank(cipher)) {
cipher = wechatGroupConsr.getCipherByRobotAndUserWxId(agreeAddUserDTO.getRobotWxId(), agreeAddUserDTO.getUserWxId());
}
......
......@@ -110,4 +110,21 @@ public interface BookKeywordDao extends BaseDao<BookKeyword> {
* @date 2019/9/11 17:24
*/
void updateRank(Long bookGroupId, Integer rank, Long partyId, Long keywordId);
/**
* 根据社群码id获取列表
* @param bookGroupId
* @return
*/
List<KeywordDTO> getListByBookGroupId(Long bookGroupId);
/**
* 根据社群码id集合获取列表
*/
List<KeywordDTO> getListByBookGroupIdsAndType(List<Long> bookGroupIds, Integer replyType);
/**
* 根据社群码id逻辑删除
*/
void deleteByBookGroupIds(List<Long> bookGroupIds);
}
......@@ -144,4 +144,22 @@ public class BookKeywordDaoImpl extends BaseDaoImpl<BookKeyword> implements Book
paramMap.put("keywordId", keywordId);
this.getSqlSession().update(this.getStatement("updateRank"), paramMap);
}
@Override
public List<KeywordDTO> getListByBookGroupId(Long bookGroupId) {
return this.getSqlSession().selectList(this.getStatement("getListByBookGroupId"), bookGroupId);
}
@Override
public List<KeywordDTO> getListByBookGroupIdsAndType(List<Long> bookGroupIds, Integer replyType) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("bookGroupIds", bookGroupIds);
paramMap.put("replyType", replyType);
return this.getSqlSession().selectList(this.getStatement("getListByBookGroupIdsAndType"), paramMap);
}
@Override
public void deleteByBookGroupIds(List<Long> bookGroupIds) {
this.getSqlSession().update(this.getStatement("deleteByBookGroupIds"), bookGroupIds);
}
}
......@@ -49,5 +49,11 @@ public class KeywordDTO implements Serializable {
@ApiModelProperty("回复类型")
private Integer replyType;
@ApiModelProperty("社群书id")
private Long bookGroupId;
@ApiModelProperty("创建人")
private Long createUser;
}
......@@ -53,6 +53,8 @@
<result column="SECOND_TEMPLET_ID" property="secondTempletId" jdbcType="BIGINT" />
<result column="SECOND_TYPE_CODE" property="secondTypeCode" jdbcType="BIGINT" />
<result column="BOOK_GROUP_ID" property="bookGroupId" jdbcType="BIGINT" />
<result column="join_group_type" property="joinGroupType" jdbcType="INTEGER"/>
<result column="book_group_cipher" property="bookGroupCipher" jdbcType="VARCHAR"/>
</resultMap>
<resultMap id="bookListPageMap" type="bookDto" extends ="bookMap">
......@@ -557,7 +559,7 @@
B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER,
IF(ISNULL(BF.BOOK_FUND_ID),0,1) IS_FUND_SUPPORT, A.TEMPLET_ID, A.BOOK_ADVISER_ID, CONCAT('BK',A.BOOK_ID) uniqueNumber,
G.update_time LAST_MODIFIED_DATE, G.create_time CREATED_DATE, G.id BOOK_GROUP_ID, G.group_qrcode_url groupQrcodeUrl,
G.group_qrcode_name groupQrcodeName, G.dep_label_id depLabelId
G.group_qrcode_name groupQrcodeName, G.dep_label_id depLabelId, G.join_group_type, G.book_group_cipher
FROM
book_group G
LEFT JOIN BOOK_ADVISER A ON G.BOOK_ID = A.BOOK_ID AND G.CHANNEL_ID = A.CHANNEL_ID AND G.CREATE_USER = A.ADVISER_ID
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper namespace="com.pcloud.book.group.dao.impl.BookGroupCipherUserDaoImpl">
<resultMap id="BaseResultMap" type="com.pcloud.book.group.entity.BookGroupCipherUser">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="book_group_id" property="bookGroupId" jdbcType="BIGINT"/>
<result column="book_group_cipher" property="bookGroupCipher" jdbcType="VARCHAR"/>
<result column="wx_user_id" property="wxUserId" jdbcType="VARCHAR"/>
<result column="alt_id" property="altId" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id, book_group_id, book_group_cipher, wx_user_id, alt_id, create_time
</sql>
<insert id="insert" parameterType="com.pcloud.book.group.entity.BookGroupCipherUser" useGeneratedKeys="true"
keyProperty="id">
insert into book_group_cipher_user
<trim prefix="(" suffix=")" suffixOverrides=",">
book_group_id,
book_group_cipher,
wx_user_id,
alt_id,
create_time
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{bookGroupId,jdbcType=BIGINT},
#{bookGroupCipher,jdbcType=VARCHAR},
#{wxUserId,jdbcType=VARCHAR},
#{altId,jdbcType=VARCHAR},
NOW()
</trim>
</insert>
<!--根据用户查询社群码id-->
<select id="getBookGroupIdByWxUserId" parameterType="String" resultType="long">
select book_group_id from book_group_cipher_user t where t.wx_user_id=#{wxUserId} order by create_time desc limit 1
</select>
<select id="getFriendsCountByBookGroup" parameterType="long" resultType="integer">
SELECT
COUNT(DISTINCT wx_user_id)
FROM
book_group_cipher_user
WHERE
book_group_id = #{bookGroupId}
</select>
<select id="getBookGroupFriendsCountByDay" parameterType="map" resultType="com.pcloud.book.group.dto.DayCountDTO">
SELECT
COUNT(DISTINCT a.wx_user_id) count,
DATE_FORMAT(a.create_time, "%Y-%m-%d") date
FROM
(
SELECT
wx_user_id,create_time
FROM
book_group_cipher_user
WHERE
book_group_id = #{bookGroupId}
GROUP BY
wx_user_id
) AS a
WHERE
a.create_time >= #{startTime}
AND a.create_time &lt;= #{endTime}
GROUP BY
DATE_FORMAT(a.create_time, "%Y-%m-%d")
</select>
<select id="listPageFriendsStatistic" parameterType="map" resultType="com.pcloud.book.group.vo.FriendsVO">
SELECT
wx_user_id wxUserId,
alt_id robotId,
create_time createTime
FROM
book_group_cipher_user
WHERE
book_group_id = #{bookGroupId}
GROUP BY
wx_user_id,
alt_id
ORDER BY
create_time DESC,id DESC
</select>
</mapper>
\ No newline at end of file
......@@ -36,6 +36,11 @@
<result column="book_clock_info_id" property="bookClockInfoId" jdbcType="BIGINT"/>
</resultMap>
<sql id="Base_Column_List">
id, book_id, channel_id, book_group_id, classify, classify_introduce, price, product_id, product_spec_id, change_number,
rank, create_user, update_user, create_time, update_time, is_delete, has_open_learning_report
</sql>
<insert id="insert" parameterType="BookGroupClassify" useGeneratedKeys="true"
keyProperty="id">
INSERT INTO book_group_classify
......@@ -397,10 +402,11 @@
classify_id classifyId,
id groupQrcodeId,
qrcode_url qrcodeUrl,
weixin_group_id weixinGroupId,
group_name groupName
FROM
book_group_qrcode
WHERE user_number <![CDATA[ < ]]> #{changeNumber} AND classify_id = #{classifyId} AND use_state = 1 AND is_delete = 0 limit 1
WHERE user_number <![CDATA[ < ]]> #{changeNumber} AND classify_id = #{classifyId} AND use_state = 1 AND is_delete = 0 order by user_number asc limit 1
</select>
<select id="listGroupClassifyByAdviser" resultType="com.pcloud.book.group.vo.BookGroupClassifyVO" parameterType="map">
......@@ -970,4 +976,15 @@
group by bgc.id
</select>
<!--根据社群码id集合获取-->
<select id="getListByBookGroupId" parameterType="list" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM
book_group_classify t
WHERE
t.book_group_id =#{bookGroupId}
AND t.is_delete = 0
order by create_time asc
</select>
</mapper>
\ No newline at end of file
......@@ -21,6 +21,10 @@
<result column="is_delete" property="isDelete" jdbcType="BIT"/>
<result column="is_show_book_name" property="isShowBookName" jdbcType="BOOLEAN"/>
<result column="join_group_type" property="joinGroupType" jdbcType="INTEGER"/>
<result column="add_friend_guide" property="addFriendGuide" jdbcType="VARCHAR"/>
<result column="customer_service_name" property="customerServiceName" jdbcType="VARCHAR"/>
<result column="is_invite_group" property="isInviteGroup" jdbcType="BOOLEAN"/>
<result column="book_group_cipher" property="bookGroupCipher" jdbcType="VARCHAR"/>
</resultMap>
<resultMap id="BookGroupDTO" type="com.pcloud.book.group.dto.BookGroupDTO">
......@@ -47,13 +51,18 @@
<result column="book_clock_info_id" property="bookClockInfoId" jdbcType="BIGINT"/>
<result column="is_show_book_name" property="isShowBookName" jdbcType="BOOLEAN"/>
<result column="join_group_type" property="joinGroupType" jdbcType="INTEGER"/>
<result column="add_friend_guide" property="addFriendGuide" jdbcType="VARCHAR"/>
<result column="customer_service_name" property="customerServiceName" jdbcType="VARCHAR"/>
<result column="is_invite_group" property="isInviteGroup" jdbcType="BOOLEAN"/>
<result column="book_group_cipher" property="bookGroupCipher" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id, book_id, channel_id, scene_id, group_qrcode_url, group_qrcode_name, pro_label_id, dep_label_id,
pur_label_id, join_title, join_slogan, personal_qrcode_url, product_id, create_user,
create_time,
update_time, is_delete, is_show_book_name,join_group_type
update_time, is_delete, is_show_book_name,join_group_type,add_friend_guide,customer_service_name,
is_invite_group,book_group_cipher
</sql>
<select id="getById" resultMap="BaseResultMap" parameterType="java.lang.Long">
......@@ -178,6 +187,10 @@
create_time,
update_time,
is_show_book_name,
add_friend_guide,
customer_service_name,
is_invite_group,
book_group_cipher,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{bookId,jdbcType=BIGINT},
......@@ -196,6 +209,10 @@
NOW(),
NOW(),
#{isShowBookName,jdbcType=BOOLEAN},
#{addFriendGuide,jdbcType=VARCHAR},
#{customerServiceName,jdbcType=VARCHAR},
#{isInviteGroup,jdbcType=BOOLEAN},
#{bookGroupCipher,jdbcType=VARCHAR},
</trim>
</insert>
......@@ -244,6 +261,18 @@
<if test="joinGroupType != null">
join_group_type = #{joinGroupType},
</if>
<if test="addFriendGuide != null">
add_friend_guide = #{addFriendGuide},
</if>
<if test="customerServiceName != null">
customer_service_name = #{customerServiceName},
</if>
<if test="isInviteGroup != null">
is_invite_group = #{isInviteGroup},
</if>
<if test="bookGroupCipher != null">
book_group_cipher = #{bookGroupCipher},
</if>
update_time = NOW(),
</set>
where id = #{id,jdbcType=BIGINT}
......@@ -383,4 +412,50 @@
ORDER BY
g.create_time DESC, g.id DESC
</select>
<!--根据id获取社群码基本信息(包括书籍信息)-->
<select id="getBookBaseInfoById" parameterType="list" resultMap="BookGroupDTO">
SELECT
bg.id,
bg.book_id,
bg.group_qrcode_name,
bg.add_friend_guide,
bg.is_invite_group,
b.book_name,
b.cover_img book_img,
b.isbn
FROM
book_group bg
LEFT JOIN book b ON bg.book_id = b.BOOK_ID
where bg.id=#{bookGroupId}
</select>
<select id="getBookGroupFriendsCountByAdviser" resultType="integer" parameterType="long">
SELECT
COUNT(DISTINCT c.wx_id)
FROM
book_group G
LEFT JOIN join_group_cipher c ON G.id = c.book_group_id
WHERE
G.create_user = #{adviserId, jdbcType=BIGINT}
AND G.is_delete = 0
AND c.has_used = 1
</select>
<!--根据社群码暗号获取-->
<select id="getByBookGroupCipher" parameterType="String" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from book_group
where book_group_cipher=#{bookGroupCipher}
and is_delete=0
limit 1
</select>
<!--根据入群方式查询社群书集合-->
<select id="getBookGroupByJoinGroupType" parameterType="Integer" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from book_group
where join_group_type=#{joinGroupType}
and is_delete=0
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper namespace="com.pcloud.book.group.dao.impl.BookGroupServeDaoImpl">
<resultMap id="BaseResultMap" type="com.pcloud.book.group.entity.BookGroupServe">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="serve_id" property="serveId" jdbcType="BIGINT"/>
<result column="serve_type" property="serveType" jdbcType="VARCHAR"/>
<result column="serve_url" property="serveUrl" jdbcType="VARCHAR"/>
<result column="short_url" property="shortUrl" jdbcType="VARCHAR"/>
<result column="book_group_id" property="bookGroupId" jdbcType="BIGINT"/>
<result column="create_user" property="createUser" jdbcType="BIGINT"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id, serve_id, serve_type, serve_url, short_url, book_group_id, create_user, create_time
</sql>
<insert id="insert" parameterType="com.pcloud.book.group.entity.BookGroupServe" useGeneratedKeys="true"
keyProperty="id">
insert into book_group_serve
<trim prefix="(" suffix=")" suffixOverrides=",">
serve_id,
serve_type,
serve_url,
short_url,
book_group_id,
create_user,
create_time
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{serveId,jdbcType=BIGINT},
#{serveType,jdbcType=VARCHAR},
#{serveUrl,jdbcType=VARCHAR},
#{shortUrl,jdbcType=VARCHAR},
#{bookGroupId,jdbcType=BIGINT},
#{createUser,jdbcType=INTEGER},
NOW()
</trim>
</insert>
<!--批量插入-->
<insert id="batchInsert" parameterType="com.pcloud.book.group.entity.BookGroupServe" useGeneratedKeys="true" keyProperty="id">
insert into book_group_serve (
serve_id,
serve_type,
serve_url,
short_url,
book_group_id,
create_user,
create_time
) values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.serveId,jdbcType=BIGINT},
#{item.serveType,jdbcType=VARCHAR},
#{item.serveUrl,jdbcType=VARCHAR},
#{item.shortUrl,jdbcType=VARCHAR},
#{item.bookGroupId,jdbcType=BIGINT},
#{item.createUser,jdbcType=INTEGER},
NOW()
)
</foreach>
</insert>
<!--删除-->
<delete id="deleteById" parameterType="long">
delete from book_group_serve
where id=#{id}
</delete>
<!--根据社群书id获取集合-->
<select id="getListByBookGroupId" parameterType="long" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from book_group_serve
where book_group_id=#{bookGroupId}
</select>
<!--根据bookGroupId删除-->
<delete id="deleteByBookGroupId" parameterType="long" >
delete from book_group_serve
where book_group_id=#{bookGroupId}
</delete>
</mapper>
\ No newline at end of file
......@@ -700,6 +700,37 @@
from book_group_qrcode where classify_id = #{classifyId} and is_delete = 0
</select>
<!--根据社群码id集合获取-->
<select id="getListByBookGroupIds" parameterType="list" resultMap="BaseResultMap">
SELECT
t.id,
t.classify_id,
t.group_name,
t.group_seq,
t.user_number,
t.weixin_qrcode_id,
t.weixin_group_id,
t.qrcode_url,
t.use_state,
t.qrcode_state,
t.create_user,
t.create_time,
t.update_time,
t.is_delete,
t.riddle_open
FROM
book_group_qrcode t
INNER JOIN book_group_classify t1 ON t.classify_id = t1.id
WHERE
t1.book_group_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
AND t.is_delete = 0
AND t1.is_delete = 0
GROUP BY t.id
</select>
<select id="getWechatGroupInfoMap" parameterType="list" resultType="com.pcloud.book.group.dto.GroupQrcodeInfo4Advertising">
select id groupQrcodeId, group_name groupName, qrcode_url qrcodeUrl from book_group_qrcode where id in
<foreach collection="list" separator="," open="(" close=")" item="id">
......
......@@ -4,6 +4,7 @@
<resultMap id="BaseResultMap" type="com.pcloud.book.group.entity.JoinGroupCipher">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="cipher" property="cipher" jdbcType="VARCHAR"/>
<result column="book_group_id" property="bookGroupId" jdbcType="BIGINT"/>
<result column="classify_id" property="classifyId" jdbcType="BIGINT"/>
<result column="qrcode_id" property="qrcodeId" jdbcType="BIGINT"/>
<result column="wechat_user_id" property="wechatUserId" jdbcType="BIGINT"/>
......@@ -16,7 +17,7 @@
</resultMap>
<sql id="Base_Column_List">
id, cipher, classify_id, qrcode_id, create_time, wechat_user_id, update_time, wx_id, has_used, alt_id, type
id, cipher, book_group_id, classify_id, qrcode_id, create_time, wechat_user_id, update_time, wx_id, has_used, alt_id, type
</sql>
<insert id="insert" parameterType="com.pcloud.book.group.entity.JoinGroupCipher" useGeneratedKeys="true"
......@@ -24,6 +25,7 @@
insert into join_group_cipher
<trim prefix="(" suffix=")" suffixOverrides=",">
cipher,
book_group_id,
classify_id,
qrcode_id,
create_time,
......@@ -34,6 +36,7 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{cipher,jdbcType=VARCHAR},
#{bookGroupId,jdbcType=BIGINT},
#{classifyId,jdbcType=BIGINT},
#{qrcodeId,jdbcType=BIGINT},
now(),
......@@ -105,6 +108,26 @@
AND c.wx_id = #{wxId}
</select>
<!--根据条件获取-->
<select id="getByCondition" parameterType="map" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from join_group_cipher
where wechat_user_id=#{wechatUserId} and
book_group_id=#{bookGroupId} and
type=#{type}
</select>
<!--根据用户微信id、机器人id、类型获取暗号集合-->
<select id="getListByAltIdAndWxIdAndType" parameterType="map" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from join_group_cipher
where wx_id=#{userWxId} and
alt_id=#{robotId} and
type=#{type}
</select>
<!--根据用户id和群id获取基本信息-->
<select id="getByWechatUserIdAndQrcodeId" parameterType="map" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/> from join_group_cipher
......
......@@ -2,6 +2,27 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper namespace="com.pcloud.book.keywords.dao.impl.BookKeywordDaoImpl">
<resultMap id="BaseResultMap" type="com.pcloud.book.keywords.entity.BookKeyword">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="keyword_id" property="keywordId" jdbcType="BIGINT"/>
<result column="book_group_id" property="bookGroupId" jdbcType="BIGINT"/>
<result column="book_id" property="bookId" jdbcType="BIGINT"/>
<result column="channel_id" property="channelId" jdbcType="BIGINT"/>
<result column="classify_id" property="classifyId" jdbcType="BIGINT"/>
<result column="rank" property="rank" jdbcType="TINYINT"/>
<result column="set_type" property="setType" jdbcType="TINYINT"/>
<result column="create_user" property="createUser" jdbcType="BIGINT"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_user" property="updateUser" jdbcType="BIGINT"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
<result column="is_warehouse" property="isWarehouse" jdbcType="TINYINT"/>
<result column="warehouse_id" property="warehouseId" jdbcType="BIGINT"/>
<result column="is_edit" property="isEdit" jdbcType="TINYINT"/>
</resultMap>
<sql id="Base_Column_List">
id,keyword_id,book_group_id, book_id, channel_id, classify_id, rank, set_type, is_delete,create_user, create_time, update_user,
update_time, is_warehouse, warehouse_id, is_edit
</sql>
<insert id="insert" parameterType="bookKeyword" useGeneratedKeys="true"
keyProperty="id">
insert into book_keyword
......@@ -381,4 +402,63 @@
AND t2.reply_type = 4
order by t.create_time desc
</select>
<!--根据社群码id获取列表-->
<select id="getListByBookGroupId" resultType="com.pcloud.book.keywords.dto.KeywordDTO" parameterType="Long">
SELECT
k.keywords,
k.id keywordId,
bk.is_warehouse as isWarehouse,
bk.warehouse_id as warehouseId,
k.guide
FROM
book_keyword bk
JOIN
keyword k ON bk.keyword_id = k.id
WHERE
bk.is_delete = 0
AND
k.is_delete = 0
AND book_group_id = #{bookGroupId} order by bk.rank, bk.id desc
</select>
<!--根据社群码id获取列表-->
<select id="getListByBookGroupIdsAndType" resultType="com.pcloud.book.keywords.dto.KeywordDTO" parameterType="map">
SELECT
k.keywords,
k.id keywordId,
bk.is_warehouse as isWarehouse,
bk.warehouse_id as warehouseId,
bk.book_group_id bookGroupId,
k.guide,
k.reply_type replyType,
k.content,
k.description,
k.link_url linkUrl,
k.serve_id serveId,
k.serve_type serveType,
bk.create_user createUser
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.book_group_id in
<foreach collection="bookGroupIds" separator="," index="index" item="item" open="(" close=")">
#{item}
</foreach>
and k.reply_type=#{replyType}
</select>
<!--根据社群码id逻辑删除-->
<update id="deleteByBookGroupIds" parameterType="list">
update book_keyword set is_delete=1,update_time=now()
where book_group_id in
<foreach collection="list" separator="," index="index" item="item" open="(" close=")">
#{item}
</foreach>
</update>
</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