Commit d015c0c8 by jinxin

Merge branch 'developer-2023-02-15' into test_branch

parents 594977f3 77f7c838
......@@ -73,4 +73,6 @@ public interface GroupChatMapper {
public void updateChatEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("enterpriseId") String enterpriseId, @Param("groupChatIdList") List<Long> groupChatIdList,
@Param("force") int force);
public List<GroupChatDTO> listChangeOwner() ;
}
\ No newline at end of file
......@@ -392,6 +392,27 @@ public class GroupChatServiceImpl implements GroupChatService {
}
this.syncGroupChatList(qwDTO, Arrays.asList(userId), null, false);
}
private void updateChatStatusTimer() {
List<GroupChatDTO> dtoList = this.groupChatMapper.listChangeOwner() ;
if(CollectionUtils.isNotEmpty(dtoList)) {
for(GroupChatDTO dto : dtoList) {
String staffId = dto.getStaffId();
String wxEnterpriseId = dto.getWxEnterpriseId() ;
TabHaobanStaff staff = this.staffMapper.selectByPrimaryKey(staffId);
if (null == staff) {
logger.info("群主已删除,staffid={}", staffId);
continue;
}
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
String userId = staff.getWxUserId();
if (qwDTO.needOpenUserId3th()) {
userId = staff.getWxOpenUseId();
}
this.syncGroupChatList(qwDTO, Arrays.asList(userId), null, false);
}
}
}
@Override
public void initHaobaonGroupChat(String params) {
......@@ -448,6 +469,12 @@ public class GroupChatServiceImpl implements GroupChatService {
e.printStackTrace();
}
}
try {
logger.info("转移群的状态");
this.updateChatStatusTimer();
} catch (Exception e) {
e.printStackTrace();
}
}
private void dimissionOwner(String wxEnterpriseId, String wxUserId, String wxOpenUserId) {
......
......@@ -318,7 +318,7 @@
<!-- 其他占用 -->
<if test="occupy != null and 1==occupy">
and a.status_flag = 0 and a.del_time >= DATE_FORMAT(NOW(),'%Y-%m-%d') and a.active_status = 1
and a.status_flag = 0 and a.del_time >= DATE_FORMAT(NOW(),'%Y-%m-%d') and a.active_status = 1 and a.expire_time >= DATE_FORMAT(NOW(),'%Y-%m-%d')
</if>
<!-- -->
<if test="occupy != null and 2==occupy">
......
......@@ -359,4 +359,8 @@
and delete_flag = 0
</update>
<select id="listChangeOwner" resultType="com.gic.haoban.manage.api.dto.chat.GroupChatDTO">
select wx_enterprise_id wxEnterpriseId , staff_id staffId FROM tab_haoban_group_chat WHERE update_time > DATE_ADD(NOW(),INTERVAL -7 DAY) AND chat_status = 1 and staff_id is not null
</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