Commit 42b72490 by 徐高华

转移群的状态定时处理

parent e0f455fa
...@@ -73,4 +73,6 @@ public interface GroupChatMapper { ...@@ -73,4 +73,6 @@ public interface GroupChatMapper {
public void updateChatEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId, public void updateChatEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("enterpriseId") String enterpriseId, @Param("groupChatIdList") List<Long> groupChatIdList, @Param("enterpriseId") String enterpriseId, @Param("groupChatIdList") List<Long> groupChatIdList,
@Param("force") int force); @Param("force") int force);
public List<GroupChatDTO> listChangeOwner() ;
} }
\ No newline at end of file
...@@ -392,6 +392,27 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -392,6 +392,27 @@ public class GroupChatServiceImpl implements GroupChatService {
} }
this.syncGroupChatList(qwDTO, Arrays.asList(userId), null, false); 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 @Override
public void initHaobaonGroupChat(String params) { public void initHaobaonGroupChat(String params) {
...@@ -448,6 +469,12 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -448,6 +469,12 @@ public class GroupChatServiceImpl implements GroupChatService {
e.printStackTrace(); e.printStackTrace();
} }
} }
try {
logger.info("转移群的状态");
this.updateChatStatusTimer();
} catch (Exception e) {
e.printStackTrace();
}
} }
private void dimissionOwner(String wxEnterpriseId, String wxUserId, String wxOpenUserId) { private void dimissionOwner(String wxEnterpriseId, String wxUserId, String wxOpenUserId) {
......
...@@ -359,4 +359,8 @@ ...@@ -359,4 +359,8 @@
and delete_flag = 0 and delete_flag = 0
</update> </update>
<select id="listChangeOwner" resultType="com.gic.haoban.manage.api.dto.chat.GroupChatDTO">
select wx_enterprise_id , staff_id FROM tab_haoban_group_chat WHERE update_time > DATE_ADD(NOW(),INTERVAL -7 DAY) AND chat_status = 2 and staff_id is not null
</select>
</mapper> </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