Commit ae1652f2 by 裴大威

Merge branch 'ruansiyuan' of http://192.168.89.173/rays/pcloud-book into feat-dw

parents 45a46305 a73c67b3
......@@ -267,4 +267,9 @@ public interface BookGroupBiz {
* 获取所有的大类分类
*/
List<LargeTempletDTO> getAllLargTemplet();
/**
* 根据微信id和机器人id获取分类集合
*/
List<Long> getClassifyIdsByWxIdAndAltId(String wxId,String altId);
}
......@@ -1109,6 +1109,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
joinGroupCipherNew.setCipher(cipher);
joinGroupCipherNew.setWechatUserId(wechatUserId);
joinGroupCipherNew.setClassifyId(classifyId);
joinGroupCipherNew.setAltId(selfRobotDTO.getWxId());
joinGroupCipherDao.insert(joinGroupCipherNew);
}
ownAltQrcodeInfoDTO.setCipher(cipher);
......@@ -1174,4 +1175,17 @@ public class BookGroupBizImpl implements BookGroupBiz {
return list;
}
@ParamLog("根据微信id和机器人id获取分类集合")
@Override
public List<Long> getClassifyIdsByWxIdAndAltId(String wxId, String altId) {
if (StringUtil.isEmpty(wxId) || StringUtil.isEmpty(altId)) {
return new ArrayList<>();
}
List<Long> list = joinGroupCipherDao.getClassifyIdsByWxIdAndAltId(wxId, altId);
if (list == null) {
return new ArrayList<>();
}
return list;
}
}
......@@ -4,6 +4,8 @@ import com.pcloud.book.group.dto.JoinGroupCiperDTO;
import com.pcloud.book.group.entity.JoinGroupCipher;
import com.pcloud.common.core.dao.BaseDao;
import java.util.List;
public interface JoinGroupCipherDao extends BaseDao<JoinGroupCipher> {
JoinGroupCipher getByWechatUserId(Long wechatUserId,Long classifyId);
......@@ -12,4 +14,6 @@ public interface JoinGroupCipherDao extends BaseDao<JoinGroupCipher> {
JoinGroupCiperDTO getDTOByCipher(String cipher);
void updateCipherStateToUsed(String cipher, String wxId);
List<Long> getClassifyIdsByWxIdAndAltId(String wxId, String altId);
}
......@@ -7,6 +7,7 @@ import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -41,4 +42,12 @@ public class JoinGroupCipherDaoImpl extends BaseDaoImpl<JoinGroupCipher> impleme
map.put("wxId",wxId);
this.getSqlSession().update(this.getStatement("updateCipherStateToUsed"), map);
}
@Override
public List<Long> getClassifyIdsByWxIdAndAltId(String wxId, String altId) {
Map<String,Object> map=new HashMap<>();
map.put("wxId",wxId);
map.put("altId",altId);
return this.getSqlSession().selectList(this.getStatement("getClassifyIdsByWxIdAndAltId"), map);
}
}
......@@ -26,6 +26,9 @@ public class JoinGroupCipher extends BaseEntity {
@ApiModelProperty("是否使用")
private Boolean hasUsed;
@ApiModelProperty("机器人id")
private String altId;
public String getCipher() {
return cipher;
}
......@@ -66,6 +69,14 @@ public class JoinGroupCipher extends BaseEntity {
this.hasUsed = hasUsed;
}
public String getAltId() {
return altId;
}
public void setAltId(String altId) {
this.altId = altId;
}
@Override
public String toString() {
return "JoinGroupCipher{" +
......@@ -74,6 +85,7 @@ public class JoinGroupCipher extends BaseEntity {
", wechatUserId=" + wechatUserId +
", wxId='" + wxId + '\'' +
", hasUsed=" + hasUsed +
", altId='" + altId + '\'' +
"} " + super.toString();
}
}
......@@ -120,9 +120,9 @@ public class WXGroupLearningReportListener {
sendPicMessageVO.setWxGroupId(wechatGroupId);
sendPicMessageVO.setAltId(alt);
sendPicMessageVO.setIp(findIp(wechatGroupId));
LOGGER.info("发送分享图消息开始"+sendTextMessageVO.toString());
LOGGER.info("发送分享图消息开始"+sendPicMessageVO.toString());
WxGroupSDK.sendPicMessage(sendPicMessageVO);
LOGGER.info("发送分享图消息开始"+sendTextMessageVO.toString());
LOGGER.info("发送分享图消息开始"+sendPicMessageVO.toString());
} catch (Exception e) {
LOGGER.error("接收学习报告topic失败" + e.getMessage(), e);
}
......
......@@ -8,12 +8,13 @@
<result column="wechat_user_id" property="wechatUserId" jdbcType="BIGINT"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
<result column="wx_id" property="wxId" jdbcType="BIGINT"/>
<result column="wx_id" property="wxId" jdbcType="VARCHAR"/>
<result column="has_used" property="hasUsed" jdbcType="BOOLEAN"/>
<result column="alt_id" property="altId" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id, cipher, classify_id, create_time, wechat_user_id, update_time, wx_id, has_used
id, cipher, classify_id, create_time, wechat_user_id, update_time, wx_id, has_used, alt_id
</sql>
<insert id="insert" parameterType="com.pcloud.book.group.entity.JoinGroupCipher" useGeneratedKeys="true"
......@@ -24,14 +25,16 @@
classify_id,
create_time,
wechat_user_id,
has_used
has_used,
alt_id
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{cipher,jdbcType=BIGINT},
#{cipher,jdbcType=VARCHAR},
#{classifyId,jdbcType=BIGINT},
now(),
#{wechatUserId,jdbcType=BIGINT},
0
0,
#{altId,jdbcType=VARCHAR}
</trim>
</insert>
......@@ -65,4 +68,12 @@
update_time=now()
where cipher=#{cipher}
</update>
<!--根据微信id和机器人id获取分类集合-->
<select id="getClassifyIdsByWxIdAndAltId" parameterType="map" resultType="long">
select classify_id from join_group_cipher where
has_used=1
and alt_id=#{altId}
and wx_id=#{wxId}
</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