Commit 0ecb6d7c by 高鹏

Merge branch 'mymaster' into 'master'

如果数据库微信群名称超过16,就截断,然后重新设置数据库的名称,因为wxgroup那边设置的时候截断了

See merge request rays/pcloud-book!11
parents 1d2176ac 311eb75a
......@@ -144,4 +144,10 @@ public interface GroupQrcodeDao extends BaseDao<GroupQrcode> {
* @return
*/
List<String> getWeixinGroupIdsByClassifyIdList(List<Long> classifyIds);
/**
* 修改群名称
* @param id
* @param groupName
*/
void updateGroupName(Long id, String groupName);
}
......@@ -129,4 +129,11 @@ public class GroupQrcodeDaoImpl extends BaseDaoImpl<GroupQrcode> implements Grou
public List<String> getWeixinGroupIdsByClassifyIdList(List<Long> classifyIds) {
return this.getSqlSession().selectList(this.getStatement("getWeixinGroupIdsByClassifyIdList"), classifyIds);
}
@Override
public void updateGroupName(Long id, String groupName) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("id", id);
paramMap.put("groupName", groupName);
this.getSqlSession().update(this.getStatement("updateGroupName"), paramMap);
}
}
......@@ -41,9 +41,15 @@ public class UpdateWXGroupNameListener {
LOGGER.info("没有找到该群" + wechatGroupId);
return;
}
if (!groupNameDTO.getNewGroupName().equals(groupQrcode.getGroupName())) {
String groupName = groupQrcode.getGroupName();
// 如果数据库微信群名称超过16,就截断,然后重新设置数据库的名称,因为wxgroup那边设置的时候截断了
if (groupName.length() > 16) {
groupName = groupName.substring(0, 16);
groupQrcodeDao.updateGroupName(groupQrcode.getId(), groupName);
}
if (!groupNameDTO.getNewGroupName().equals(groupName)) {
ChangeNameVO changeNameVO = new ChangeNameVO();
changeNameVO.setName(groupQrcode.getGroupName());
changeNameVO.setName(groupName);
changeNameVO.setWxGroupId(wechatGroupId);
String altId = wechatGroupConsr.getRobotIdByGroupId(wechatGroupId);
changeNameVO.setAltId(altId);
......
......@@ -298,4 +298,13 @@
${item}
</foreach>
</select>
<!--修改群名称-->
<update id="updateGroupName" parameterType="map">
update book_group_qrcode
<set>
group_name = #{groupName},
update_time = now()
</set>
WHERE id = #{id}
</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