Commit e9405077 by 阮思源

修改下

parent 940b0f40
......@@ -263,4 +263,5 @@ public interface BookGroupClassifyDao extends BaseDao<BookGroupClassify> {
List<ListClassifyVO> getClassifyIngoreDelete(Long bookGroupId);
List<BookGroupClassify> getListByBookGroupIds(List<Long> bookGroupIds);
}
......@@ -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> getListByBookGroupIds(List<Long> bookGroupIds) {
return this.getSqlSession().selectList(this.getStatement("getListByBookGroupIds"), bookGroupIds);
}
}
......@@ -23,6 +23,7 @@ import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.dto.GroupClassifyQrcodeDTO;
import com.pcloud.book.group.dto.JoinGroupCipherDTO;
import com.pcloud.book.group.entity.AppTouchRecord;
import com.pcloud.book.group.entity.BookGroupClassify;
import com.pcloud.book.group.entity.GroupQrcode;
import com.pcloud.book.group.entity.JoinGroupCipher;
import com.pcloud.book.group.enums.CipherTypeEnum;
......@@ -583,17 +584,33 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
@ParamLog("根据关键词判断关键词是否为1V1社群群名称")
private void inviteToGroupByKeyword(SendTextDTO sendTextDTO, List<JoinGroupCipher> joinGroupCiphers) {
List<Long> bookGroupIds = joinGroupCiphers.stream().filter(s -> s.getBookGroupId() != null).map(JoinGroupCipher::getBookGroupId).collect(Collectors.toList());
List<Long> bookGroupIds = new ArrayList<>();
Map<Long, JoinGroupCipher> map = new HashMap<>();
for (JoinGroupCipher joinGroupCipher : joinGroupCiphers) {
if (joinGroupCipher.getBookGroupId() != null) {
map.put(joinGroupCipher.getBookGroupId(), joinGroupCipher);
bookGroupIds.add(joinGroupCipher.getBookGroupId());
}
}
if (!ListUtils.isEmpty(bookGroupIds)) {
List<GroupQrcode> groupQrcodes = groupQrcodeDao.getListByBookGroupIds(bookGroupIds);
if (!ListUtils.isEmpty(groupQrcodes)){
for (GroupQrcode groupQrcode:groupQrcodes){
if (groupQrcode.getGroupName().equals(sendTextDTO.getTextContent())){
List<BookGroupClassify> bookGroupClassifyList = bookGroupClassifyDao.getListByBookGroupIds(bookGroupIds);
if (!ListUtils.isEmpty(bookGroupClassifyList)) {
for (BookGroupClassify bookGroupClassify : bookGroupClassifyList) {
if (bookGroupClassify.getClassify().equals(sendTextDTO.getTextContent())) {
//分配群
JoinGroupCipher jgc = map.get(bookGroupClassify.getBookGroupId());
if (jgc == null) {
continue;
}
GroupQrcodeBaseInfoVO wxGroup = bookGroupClassifyBiz.getWxGroupIdByClassifyIdAndWechatId(bookGroupClassify.getId(), jgc.getWechatUserId());
if (null == wxGroup) {
throw new BookBizException(BookBizException.ID_NOT_EXIST, "群不存在" + bookGroupClassify.toString() + jgc.toString());
}
//发送邀请入群
SendGroupInviteVO sendGroupInviteVO = new SendGroupInviteVO();
sendGroupInviteVO.setAltId(sendTextDTO.getWxId());
sendGroupInviteVO.setWxId(sendTextDTO.getWechatUserId());
sendGroupInviteVO.setWxGroupId(groupQrcode.getWeixinGroupId());
sendGroupInviteVO.setWxGroupId(wxGroup.getWeixinGroupId());
sendGroupInviteVO.setIp(sendTextDTO.getIp());
WxGroupSDK.sendGroupInvite(sendGroupInviteVO);
log.info("[同意加好友发送欢迎语] 发送进群链接 sendGroupInviteVO:{}", sendGroupInviteVO);
......
......@@ -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,
qrcode_head_url, 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
......@@ -967,4 +972,17 @@
group by bgc.id
</select>
<!--根据社群码id集合获取-->
<select id="getListByBookGroupIds" parameterType="list" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM
book_group_classify t
WHERE
t.book_group_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
AND t.is_delete = 0
</select>
</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